我在网络服务器上工作。
之前:有一个网站。 “domain.com/”重定向到“domain.com/index.html”(逻辑),此页面重定向到“domain.com/en/index.html”,标签为: "meta http-equiv="refresh"content="0;url=en/index.html""
现在:有一个 Wordpress(我安装了它),没有 index.html 但有 index.php。
问题:当我想访问“domain.com”时,我被重定向到 domain.com/en/index.html。
我知道这是一个缓存问题,但是如何禁用这个缓存。重定向 ?
我找到了一个关于 htaccess 的解决方案(add Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate")但它不起作用。
最佳答案
我猜这实际上是一个 DirectoryIndex
问题,而不是缓存问题。
如果你看the documentation ,您会看到该指令采用 Apache 尝试按顺序查找的索引列表。因此,您可以通过将 index.php
移动到列表的前面来强制其优先级
DirectoryIndex index.php index.html
关于php - 如何强制刷新网页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32312484/