我需要找到正确查询的方法重定向301?
我有一个有关重定向查询301 ...旧链接的问题
:https://example.com/about.php?lang=1
新链接:https://example.com/about
我尝试了很多.htaccess规则的示例,但是如果有人可以帮助分享工作查询,则找不到重定向查询的规则?
我尝试的样本:
RewriteCond %{HTTP_HOST} ^example\.com$ RewriteCond %{QUERY_STRING} ^lang\=1$
RewriteRule ^/?about\.php$ example.com/about? [L,R=301,QSD,NC]
RewriteCond %{QUERY_STRING} (^|&)lang\=1($|&)
RewriteRule ^about\.php$ nalyvky.com/about [R=301,L]
I have a question about redirect query 301...
Old Link: https://example.com/about.php?lang=1
New Link: https://example.com/about
I try a lot of samples for rules for .htaccess, but can't find rules for redirect queries, if someone can help share the work query?
Sample that i'm try it:
RewriteCond %{HTTP_HOST} ^example\.com$ RewriteCond %{QUERY_STRING} ^lang\=1$
RewriteRule ^/?about\.php$ example.com/about? [L,R=301,QSD,NC]
RewriteCond %{QUERY_STRING} (^|&)lang\=1($|&)
RewriteRule ^about\.php$ nalyvky.com/about [R=301,L]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能是您要寻找的:
它将所有请求重定向到
https://example.com/about.php?lang=1
https://example.com/about
通过301 HTTP响应。通常,此类重定向与内部重写结合在一起,以便能够处理此类重定向请求:
假设HTTP主机与设置无关,您的问题对此有点模糊...
This probably is what you are looking for:
It externally redirects all requests to
https://example.com/about.php?lang=1
tohttps://example.com/about
by means of a 301 http response.Often such redirection is combined with an internal rewrite to be able to process such redirected requests:
This assumes that the http host is irrelevant for the setup, your question is a bit fuzzy in that ...