【发布时间】:2016-04-07 18:40:26
【问题描述】:
第 1 点 如果我输入:
www.myurl.com/somepage
http://www.myurl.com/somepage
http://myurl.com/somepage
https://myurl.com/somepage
让它重定向到
https://www.myurl.com/somepage
第 2 点
When I type in something like www.myurl.com it is redirecting to https://www.myurl.com/index.php.
Make it so the index.php is not displaying. It should just display https://www.myurl.com
来自评论 htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^myhost\.com$ [NC]
RewriteRule ^(.*)$ myhost.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /index\.php(/[^\ ]*)?\ HTTP/
RewriteRule ^index\.php(/(.*))?$ myhost.com/$2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
【问题讨论】:
-
设置这个
$route['404_override'] = ''; -
已经设置。但是同样的问题发生了
-
也设置你的htaccess
-
如何在htaccess中设置?
-
我已经在 htaccess RewriteEngine On RewriteCond %{HTTP_HOST} ^myhost\.com$ [NC] RewriteRule ^(.*)$ myhost.com/$1 [R=301,L] RewriteCond %{THE_REQUEST } ^[AZ]+\ /index\.php(/[^\ ]*)?\ HTTP/ RewriteRule ^index\.php(/(.*))?$ myhost.com/$2 [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] 但问题是..如果我输入 www.myhost.com 然后它重定向到 www .myhost.com。我想重定向myhost.com。
标签: php .htaccess codeigniter