Changes to .htaccess ignored

.htaccess

I have a website on the server, containing .htaccess. For testing purposes I wanted to replace it with another .htaccess, but changes have been ignored. Even though I have replaced with new .htaccess or even deleted it from server root, website is still working, like I haven't done any changes.

Basically new .htaccess is being ignored, it's like server cached it and doesn't care about the new one. Because of that a testing site won't work since old rewrite rules are still in place. All I know about server is that it's Linux.

Is there any way to make server see the changes? I cannot restart server.


EDIT: As it turns out it's nginx server, therefore .htaccess isn't allowed.

Best Answer

Is AllowOverride set for the directory containing your .htaccess file in httpd.conf? If not, .htaccess will be ignored.

Normally, .htaccess files will not be used in the server root directory, which you mention.

Unfortunately, you will need to restart Apache in order to pick up changes in httpd.conf. Once that is done, you do not need to restart Apache when you change .htaccess.