I’m working on a web server.
BEFORE: There was a website. “domain.com/” redirected to “domain.com/index.html” (logic) and this page redirected to “domain.com/en/index.html” with the tag :
“meta http-equiv=”refresh” content=”0;url=en/index.html”“
NOW: There is a WordPress (I installed it), without index.html but an index.php.
THE PROBLEM: When I want to access to “domain.com”, I am redirected to domain.com/en/index.html.
I know it is a cache problem but how to disabled this cache. Redirection ?
I have found a solution about the htaccess (add Header set Cache-Control “max-age=0, no-cache, no-store, must-revalidate” ) but it doesn’t work.
I’m guessing this is actually a
DirectoryIndex
issue, not a cache one.If you look at the documentation, you see that this directive takes a list of indexes which Apache attempts to locate in order. Therefor, you can force priority for
index.php
by moving it to the front of the listIf the redirect is a 301, then you need to use “Forget about this site” because 301 is a permanent redirect and will be saved in browser cache. A simple page reload will not refresh the cache.
I’ve often stumble upon this scenario:
foo.com
redirects using301
tobar.com
, when you first visitfoo.com
, the browser will remember that redirect and the next time you visitfoo.com
, the browser will not even connect tofoo.com
, but instead connect directly tobar.com
.@edit:
It seems to be a 302 redirect.
Just edit
yourwebsite.com/index.html
and change frommeta http-equiv="refresh" content="0;url=en/index.html
tometa http-equiv="refresh" content="0;url=en/index.php
. Basically, change the extension from .html to .php in the refresh meta.