Hướng dẫn cấu hình .htaccess redirect http qua https
Hướng dẫn cấu hình .htaccess redirect http qua https If you see #SERVER-HTTPS-ON# (on), add <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTPS} !=on [NC] RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </IfModule> If you see #SERVER-HTTPS-ON# (1), add <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTPS} !=1 RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </IfModule> If you see #SERVERPORT443#, add <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{SERVER_PORT} !443 RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </IfModule> If you see #LOADBALANCER#, add <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </IfModule> If you see #CDN#, add <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP:X-Forwarded-SSL} !on RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </IfModule> If you see #Cloudflare#, add <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP:CF-Visitor} ‘”scheme”:”http”‘ RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </IfModule> If you see #ENVHTTPS#, add <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{ENV:HTTPS} !=on RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </IfModule> Hay dùng nhất là: RewriteEngine on RewriteCond %{HTTPS} !=on [NC] RewriteRule ^(.*)$ https://domain.com/$1 [R=301,L] or RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] :battay: |
Bây giờ là 07:52 PM. Giờ GMT +7 |
Diễn đàn tin học QuantriNet
quantrinet.com | quantrimang.co.cc
Founded by Trương Văn Phương | Developed by QuantriNet's members.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.