我需要重定向301搜索结果

时间:2018-10-29 04:15:18

标签: redirect

我需要重定向自:

name="stripeToken"

我正在使用:

/?s=search&post_type=library to /library/?s=search&post_type=library

也:

RewriteRule ^s=(.*)%&post_type%=library$ https://www.cyberdocentes.com/library/$1 [R=301,L]

并且:

RewriteCond %{QUERY_STRING} ^s=(.*)%&post_type=library$ 
RewriteRule ^$ https://www.cyberdocentes.com/library/$1 [R=301,L]

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

我已经解决了重定向问题,正在使用:

要将post_type的结果重定向到“库”页面:

RewriteCond %{QUERY_STRING} ^s=(.*)&post_type=library$
RewriteRule ^$ https://www.cyberdocentes.com/library/$1 [R=301,L]

并将文章的搜索结果重定向到“博客”页面:

RewriteCond %{QUERY_STRING} ^s=(.*)$
RewriteRule ^$ https://www.cyberdocentes.com/blog/?s=%1 [L=301,R]

如果您有更好的解决方案,希望您对我有所帮助。