http://www.example.com/blog/demo/first-post
http://www.example.com/blog/test/second-post
我想重写上述网址与htaccess的下面,
http://www.example.com/first-post
http://www.example.com/second-post
简单地说,
如果请求的URI包含子'博客',应该删除'博客',下一个项目,concatinate遗体与firstpart
感谢
解决方案 重写规则^ /博客/.*?/(.*)$ $ 1 [NC,L]
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 'blog' and the next item and concatinate the remains with firstpart
Thanks
解决方案RewriteRule ^/blog/.*?/(.*)$ $1 [NC,L]