I can't get it work this part of .htaccess, the IfDefine
never runs. What am I doing wrong, setenvif
mod is enabled.
RewriteBase /
SetEnvIf HTTP_HOST ^localhost$ local
<IfDefine local>
RewriteBase /codeigniter-app/
</IfDefine>
SetEnvIf HTTP_HOST ^testing.alex.com$ testing
<IfDefine testing>
RewriteBase /app/
</IfDefine>
This is based on: With mod_rewrite can I specify a RewriteBase within a RewriteCond?
Edit: Any other way to accomplish the above?
SetEnvIf works on request headers. So you want to use HOST not HTTP_HOST. E.g.
SetEnvIf HOST ^localhost$ local