htaccess文件中的301重定向或URL重定向

时间:2016-11-21 05:15:26

标签: .htaccess redirect url-redirection

我想将查询字符串URL重定向到.htaccess文件中我自己的URL。我找不到任何解决方案,请帮帮我。我想将带有查询字符串https://example.com/?p=3842的网址重定向到https://example.com/,就像我要重定向它一样。任何帮助,将不胜感激 。提前谢谢!

1 个答案:

答案 0 :(得分:0)

有许多使用查询字符串匹配的示例。

RewriteEngine on
RewriteCond %{QUERY_STRING} p=3842
RewriteRule ^ /? [R=301,L]

请务必告诉我这对您有何帮助。

相关问题