Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这个网址
www.example.com/nothing_here?registration=disabled
我想将它重定向到
www.example.com/errors/418.php
我无法摆脱 url 的 nothing_here 部分。这该怎么做?
谢谢
在文档根目录的 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]