How to apply different .htaccess rules based on the uri
I have a website running on ExpressionEngine and a custom backoffice based on Zend. Both approaches expect a specific htaccess file placed in the root.
This is my structure.
- http://localhost/... (ExpressionEngine pages, eg. http://localhost/calendar/events)
- http://localhost/backoffice (Backoffice pages)
Before placing the backoffice on a subdomain, I wanted to know if it's possibile to have one htacces file and to apply a different set of htaccess rules based on the uri. So eg. everything with "backoffice" gets different rule开发者_JS百科s.
I know you can do stuff like this: Best I've found was the following Can I do an if/then/else in htaccess? But I'm stuck with defined the variables based on the uri.
Thanks for your help.
regards Vic
Put your rewrite rules for EE first and add a rule for the back office there:
RewriteCond %{REQUEST_URI} !/backoffice
RewriteRule ^ /index.php [L]
And now add the rules for the back office.
精彩评论