开发者

Htaccess remove multiple substring or hide subdirectory(s)

开发者 https://www.devze.com 2023-02-18 03:25 出处:网络
http://www.example.com/blog/demo/first-post http://www.example.com/blog/test/second-post I would like to rewrite the above url to following with htaccess,
http://www.example.com/blog/demo/first-post
http://www.example.com/blog/test/second-post

I would like to rewrite the above url to following with htaccess,

http://www.example.com/first-post
http://www.example.com/second-post

Simply,

If requested uri contains substring 'blog' it should remove 'blo开发者_JAVA技巧g' and the next item and concatinate the remains with firstpart

Thanks


RewriteRule ^/blog/.*?/(.*)$  $1  [NC,L]
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号