我需要重定向破碎的url
Domain.com/..php到domain.com/index.php
有人知道怎么做吗??我试着用一些htaccess生成器
http://htaccessredirect.net/index.php
得到这段代码,但重定向循环/错误
我尝试过以下代码,但不起作用
Redirect 301 /.php index.php我也试过了,但是错了
RewriteCond %{HTTP_HOST} ^/.php$
RewriteRule ^$ index.php [L,R=301]发布于 2013-12-06 08:00:43
您需要转义句点,否则它将成为正则表达式的一部分。
如下所示:
RewriteRule ^/\.php$ /index.php [L,R=301]或者:
RedirectMatch 301 ^/\.php index.phphttps://stackoverflow.com/questions/20418830
复制相似问题