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]
精彩评论