I hope I will find a help here. I have a quite complex MVC driven application.
Here how it works:
these are my directories
all 3 are accesible under one domain example.com then
So far everything is working nicely on .htaccess files (in each mvc folder) which have following code inside:
RewriteEngine on
RewriteRule !\.(js|ico|gif|jpg|png|css|htc|swf|html|xml)$ dispatcher.php
code is correct my problem is that I would like to move it into vhost.conf file or httpd.conf which is loaded into memory at Apache startup and get rid of all .httaccess to boost up Apache performance.
the current solutions its working correctly because each .htaccess is overwritting its parent directory one, which I can't have to working in vhost.conf
So far I have tried to move it into directive but without success. Any ideas ?
many thanks for help.
cheers
Try this rule:
RewriteEngine on
RewriteCond %{REQUEST_URI} !.*\.(js|ico|gif|jpg|png|css|htc|swf|html|xml)$
RewriteRule ^(/mvc2|/mvc3)?/ $1/dispatcher.php
That should redirect requests of /mvc2/…
or /mvc3/…
to the corresponding dispatcher.php . And only if the URL path does start with neither /mvc2/…
nor /mvc3/…
it's redirected to the dispatcher.php in the root directory.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.