กรุณาปิด โปรแกรมบล๊อกโฆษณา เพราะเราอยู่ได้ด้วยโฆษณาที่ท่านเห็น
Please close the adblock program. Because we can live with the ads you see


วิธีการทํา Redirect to HTTP non-www to HTTPS www ด้วย .htaccess

  • เริ่มกระทู้โดย เริ่มกระทู้โดย thxf.org
  • วันที่เริ่มกระทู้ วันที่เริ่มกระทู้
  • ตอบ ตอบ 0
  • อ่าน อ่าน 876
  • ป้ายกำกับ ป้ายกำกับ
    none www to www redirect http to https
เพิ่มข้อความด้านล่างในไฟล์ .htaccess :
HTML:
RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301]
ด้านล่างคือเชค https กับ redirect none www to www:
HTML:
RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.domain.com/$1 [L,R=301]
:5fc0f220:
 



กรุณาปิด โปรแกรมบล๊อกโฆษณา เพราะเราอยู่ได้ด้วยโฆษณาที่ท่านเห็น
Please close the adblock program. Because we can live with the ads you see
ด้านบน ด้านล่าง