27

I have added url rewrite rules to my .htaccess file. Should I see these changes working right away?

dev.e.loper
  • 35,446
  • 76
  • 161
  • 247

4 Answers4

30

Changes to .htaccess are immediate and do not require a restart. Normally, if you aren't seeing what you expect from .htaccess changes, you have a syntax error and should check Apache's logs for some idea of what's going on.

Dirk Dastardly
  • 1,017
  • 2
  • 12
  • 23
11

If you use redirect 301, clear browser cache.

Matthias
  • 1,130
  • 10
  • 8
  • 4
    In my case: chrome cache my http to https redirect. If i type the old url in the adressbar, chrome call direct the new url. even though I have switched off the .htaccess redirect again or change it. that can lead to confusion at troubleshooting, so be aware browser cache. – Matthias Apr 11 '17 at 09:47
  • I've found I had to completely exit incognito mode (all incognito tabs/windows) and then go back into a fresh incognito to properly check each `.htaccess` change. Thank you for this heads up. – Keith DC Aug 13 '19 at 22:43
7

NVM found it.

The .htaccess files follow the same syntax as the main configuration files. Since .htaccess files are read on every request, changes made in these files take immediate effect.

dev.e.loper
  • 35,446
  • 76
  • 161
  • 247
6

Apparently, some servers only check .htaccess files periodically. I've found this to be the case w/ our AWS host.

My source is only a comment below the answer here, but it matches my experiences and others seem to agree.

Kyle Vassella
  • 2,296
  • 10
  • 32
  • 62
  • This matches my experience too. Servers on some web hosting services definitely only check `.htaccess` periodically making it a pain to work with these files on those hosting services. – Miqi180 Apr 18 '22 at 11:12