0

我有这个网址

www.example.com/nothing_here?registration=disabled

我想将它重定向到

www.example.com/errors/418.php

我无法摆脱 url 的 nothing_here 部分。这该怎么做?

谢谢

4

1 回答 1

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]
于 2013-11-04T04:51:59.700 回答