If I have in my conf.d Apache directory 001_vhost.conf 002_vhost.conf ... etc, does Putting RewriteEngine On in 004_vhost.conf enable the Rewrite Engine for 005 006 007 008 etc vhosts, but not those that came before in the virtual host load order? This is assuming I don't have that directive anywhere else.


It depends where you have it in the configs (i.e. which section, not which file). For example, if you have RewriteEngine on within your VirtuaHost section, that will apply to that host only. If you put it in the global config, that will apply to the main host (not your virtual hosts which need to be enabled individually).


  • From the docs "Note that rewrite configurations are not inherited by virtual hosts. This means that you need to have a RewriteEngine on directive for each virtual host in which you wish to use rewrite rules." That is what I wanted to know, I should have checked there first, thanks. Jul 19 '14 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.