Can I force .htaccess to refresh?

I had a rewriterule in my .htaccess file like,

 RewriteCond %{HTTPS} !on
 RewriteRule (.*) https://example.com%{REQUEST_URI} [L,R=301] 

and once I opened the site in localhost it never gave me a chance to hard refresh the page.

Solution: I added a random string like localhost/mywebsite/index.php?1234


Some servers will reload as soon as you replace the .htaccess file.

If so it instantly be used for all subsequent requests. You do not need to refresh any caches.

Some servers only check htaccess periodically.


If you're using RewriteRule, just use R instead of R=301. For other purposes, you'll have to clear your browser cache whenever you change a redirect.

from https://stackoverflow.com/a/7749784/1066234