Mod Rewrite Rules Working in .htaccess But Not htconf?

90 viewsapache htaccess

I have created some rules for Apache and tested them in the .htaccess file and they have worked just fine. I copy them over to the main htconf file and put them inside the correct virtual host like I have done before but these rules aren’t being applied.

Asked question

Make sure there aren’t other rules in the .htaccess file that could be overriding it. If you added these new rules to the bottom of the .htaccess file then they will have final priority because they ran last, just like css rules. Rules in the htconf are loaded first and can then be overridden by the rules in the .htaccess file. So if you have something at the start of that .htaccess file, it will cause any of the new rules that you copied to the Apache conf file to stop working.

If you do not need the .htaccess file anymore you can use the AllowOverride None command to disable it.

Changed status to publish