[英]Remove sub directory from URL?
I'd like to rewrite: 我想重写:
http://www.example.com/item.html/category/something/something2
To : 至 :
http://www.example.com/item/something/something2
Thus getting rid of "category" and ".html" 因此摆脱了“类别”和“ .html”
I have tried: 我努力了:
#rewrite to remove "category" and ".html"
RewriteEngine On
RewriteCond %{REQUEST_URI} !^item.html/category/
RewriteRule ^item/(.*)$ /item/category/$1 [QSA,L]
Do you need the RewriteCond, just do the rewrite like so: 您是否需要RewriteCond,只需执行如下重写:
RewriteEngine On
RewriteRule ^item.html/category/(.*)$ /item/$1 [QSA,L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.