[英].htaccess Redirect Directory To Subdirectory
I am attempting to redirect my page 我正在尝试重定向我的页面
http://example.com/category/general/
to 至
http://example.com/blog/category/general/
I thought that this would work but it ends up endlessly looping 我以为这会奏效,但最终会不断循环
RedirectMatch 301 /category/general/ /blog/category/general/
You must use regex anchors as well: 您还必须使用正则表达式锚点:
RedirectMatch 301 ^/category/general/?$ /blog/category/general/
And with capturing groups: 和捕获组:
RedirectMatch 301 ^/(category/general/?)$ /blog/$1
Test this after clearing your browser cache. 清除浏览器缓存后进行测试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.