2013-11-04 39 views
0
新的一页

我有这个网址重定向查询网址到

www.example.com/nothing_here?registration=disabled 

,我想它重定向到

www.example.com/errors/418.php 

我无法摆脱的URL nothing_here部分。这个怎么做?

感谢

回答

1

在htaccess文件在你文档根,添加:

RedirectMatch 301 ^/nothing_here$ /errors/418.php? 

或使用mod_rewrite:

RewriteEngine On 
RewriteCond %{QUERY_STRING} ^registration=disabled$ [NC] 
RewriteRule ^nothing_here$ /errors/418.php [L,R=301] 
+0

第一个我不能使用,因为我不t想要重定向所有nothing_here页面。第二个我放在我的根htaccess的顶部,但URL不会被重写。任何想法为什么?谢谢 – WendiT

+0

对不起,我的坏。它完美的工作!谢谢 – WendiT