我需要的,如果一个顾客进入以下网址于浏览器上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