开发者

Apache URL rewrite question

Hello I want to redirect all the requests to url example.com/rock/apps to example.com/rock/apps/webroot using Apache rewrite rules but the main thing is I do not want webroot come in to my url

Right now I have written this

RewriteEngine On
RewriteCond %{REQUEST_FI开发者_如何学JAVALENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)$ webroot [NC,L]

Which provides example.com/rock/apps/webroot

How to eliminate that webroot from the end ?


You can probably use mod_alias in conjunction with the rewrite. Instead of webroot use some other dummy path and alias that dummy path to webroot.


your conditions...

RewriteRule ^(rock/apps)/webroot$ $1

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜