admin管理员组文章数量:1327474
On my website, I have following url structure:
example/test/
example/test/a-page
example/test/another-page
How can I redirect all of the URLS that contains /test/ right after the domain name to example/info/
I understand I can do it using htaccess, but I cannot format the rule syntax.
On my website, I have following url structure:
example/test/
example/test/a-page
example/test/another-page
How can I redirect all of the URLS that contains /test/ right after the domain name to example/info/
I understand I can do it using htaccess, but I cannot format the rule syntax.
Share Improve this question asked Aug 6, 2020 at 18:10 heeraheera 132 bronze badges1 Answer
Reset to default 0Try the following at the top of your .htaccess
file, before the existing WordPress directives:
RewriteRule ^test/ /info/ [R=302,L]
The pattern ^test/
matches all URLs that start /test/
.
Note that the URL-path matched by the RewriteRule
pattern (first argument) does not start with a slash (when used in .htaccess
).
If this is intended to be permanent then change the 302 to 301 - but only after you have tested that it works OK.
本文标签: How to redirect a page to another
版权声明:本文标题:How to redirect a page to another? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742206844a2432976.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论