0
删除多个实例的index.php我知道如何从规则在.htaccess删除的index.php:从URL
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
但我不知道当我看到这在我的404个原木做什么:
video/index.php
video/index.php/index.php
video/index.php/index.php/index.php
video/index.php/index.php/index.php/index.php
有没有办法去掉所有这些而不必拼出每一个呢?就像我可以循环通过重写规则,以不断删除index.php,直到它消失了?
非常感谢, 菲尔
噢,你会希望这是你的条件后的第一条规则。 – 2013-03-25 15:47:03
非常感谢!奇迹般有效。而且我其实还有一些更疯狂的网址(我认为有些脚本会导致它,无论是在我的网站上还是某种抓取网站上),例如http://www.mydomain.com/www.mydomain.com/www.mydomain .com/video/video1/index.php/index.php/index.php所以我除了你的代码还加入了它,它似乎工作:RewriteRule ^(。*)www \ .mydomain \ .com \/(。*)$ 1 $ 2 [R = 301,L,NC] – philraymond 2013-03-25 23:00:58
很高兴知道它适用于您。 :) – 2013-03-26 04:39:43