在我的.htacess
中寻找允许
http://example.com/index.php或http://example.com/anything-else
但重定向
http://example.com/index.php/anything-else
这就像我可以来到正确的正则表达式
RewriteEngine on
RewriteCond %{QUERY_STRING} index.php/
RewriteRule ^index\.php$ /send-them-to-404/? [L,R=301]
答案 0 :(得分:0)
您可以使用我在评论中提到的AcceptPathInfo
指令,但是如果
网址被搜索引擎编入索引,然后您需要使用301重定向将其重定向到404页面。 301将先前已编入索引的网址重新定向到新网址。
RewriteEngine on
RewriteRule ^.+\.php/.+$ /404.php [L,R=301]