2014-01-17 191 views
1

我试图将用户重定向请求
我用Redirect 301 /index.php http://mywebsite/junk/index.html
根index.php文件,而如果人们只请求的index.php,
但现在我得到很多请求 该工程确定对于index.php ++++(有时比其他++更多)
有什么我可以添加到Redirect 301 /index.php包括重定向index.php +++?停止请求+++++++++

回答

1

可以使用mod_rewrite对正则表达式的功能和更精细的控制:

RewriteEngine On 
RewriteRule ^index\.php http://mywebsite/junk/index.html [L,R] 
+0

有如何产生一个办法做到这一点没有错误404? – sp2014

+0

好吧现在尝试更新规则。 – anubhava

+0

工程伟大。 – sp2014