我需要的,如果一個顧客進入以下網址於瀏覽器上https://domain.com如何網站重定向到https://開頭不是重定向到https:// WWW
重定向。
- domain.com
- www.domain.com
- http://domain.com
- http://www.domain.com
我使用笨框架。 請分享我,如何通過更改.htaccess來管理它。
我使用下面的代碼在.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteBase /demo
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
分享你的.htaccess – Naincy
你可以用你的.htaccess做。 –
[htaccess重定向到https:// www]可能的重複(http://stackoverflow.com/questions/13977851/htaccess-redirect-to-https-www) – drmonkeyninja