【发布时间】:2017-02-09 12:10:39
【问题描述】:
我需要重定向https://domain.com
如果客户在浏览器上输入以下 URL。
- domain.com
- www.domain.com
- http://domain.com
- http://www.domain.com
我正在使用 Codeigniter 框架。 请分享我,如何通过更改 .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
-
你可以用你的 .htaccess 来做。
标签: php .htaccess codeigniter