How long does it take for .htaccess changes to take effect?

久未见 提交于 2019-12-06 17:04:07

问题


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


回答1:


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.




回答2:


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.




回答3:


If you use redirect 301, clear browser cache.




回答4:


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.



来源:https://stackoverflow.com/questions/7836845/how-long-does-it-take-for-htaccess-changes-to-take-effect

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!