linux – .htaccess redirect index.php到/
发布时间:2020-05-27 17:19:52 所属栏目:Linux 来源:互联网
导读:我想隐藏index.php页面,只显示域名. 这可能与.htaccess一起使用吗? RewriteRule ^index.php/?$/ [L,R=301,NC] 还尝试过: RewriteEngine OnRewriteBase /RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /index.php HTTP/RewriteRule ^index.php$
|
我想隐藏index.php页面,只显示域名. 这可能与.htaccess一起使用吗? RewriteRule ^index.php/?$/ [L,R=301,NC] 还尝试过: RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /index.php HTTP/
RewriteRule ^index.php$http://example.com/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
index.php仍然显示 解决方法试试吧,它对我有用!确保在httpd.conf中设置了AllowOverride AllRewriteEngine On
RewriteCond %{REQUEST_URI} index.php
RewriteRule ^(.*)index.php$/$1/ [R=301,L]
您的规则中存在正则表达式问题,我修改了您的规则并且它适用于我: RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} index.php
RewriteRule ^index.php$http://example.com/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L] (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
