【发布时间】:2013-12-06 07:56:06
【问题描述】:
我需要像这样重定向损坏的网址
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]
【问题讨论】:
-
我猜你有一个规则将 .php 添加到末尾?
-
不,两者都是 .htaccess 中的完整代码