开发者

Htaccess remove multiple substring or hide subdirectory(s)

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜