由网友(在平淡生活里创造惊喜)分享简介:http://www.example.com/blog/demo/first-posthttp://www.example.com/blog/test/second-post我想重写上述网址与htaccess的下面,http://www.example.com/first-posthttp://www.exam...![没下载完可以直接删除易升吗](https://p.xsw88.cn/allimgs/daicuo/20230902/84.png)
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
简单地说,
![没下载完可以直接删除易升吗](https://p.xsw88.cn/allimgs/daicuo/20230902/84.png)
如果请求的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]
相关推荐
最新文章