开发者

Apache URL rewrite question

开发者 https://www.devze.com 2023-02-15 20:55 出处:网络
Hello I want to redirect all the requests to urlexample.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

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

精彩评论

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