【问题标题】:.htacces worked only the first time.htaccess 只在第一次工作
【发布时间】:2018-09-09 16:08:11
【问题描述】:

我有一个愚蠢的问题。 我正在本地主机上的 wampserver 上测试重定向。 我在项目根目录上创建了一个 .htaccess,它运行良好。

.htaccess

Redirect permanent /blog/ http://foo/

但是现在,我想把.htaccess改成

Redirect permanent /blog/ http://foo/blog/

什么也没有发生...我的意思是即使我写了这个重定向仍然是相同的:

Redirect permanent /blog/ http://abcedfgh/foo/

我看到有no problem of refresh with .htaccess

我测试了 Ctrl+F5 和 Ctrl+Alt+r 来清理浏览器缓存没有成功。

有人有想法吗?

【问题讨论】:

    标签: .htaccess url-redirection


    【解决方案1】:

    要清理浏览器缓存,Ctrl+F5 或 Ctrl+Alt+R 是不够的! 我不得不进入选项浏览器。

    对于火狐:information is here

    【讨论】:

    • 301 重定向被 Web 浏览器缓存。每当您为 url 重定向测试 Redirect 或 RewriteRule 时,您应该始终使用 Temporary 302 重定向状态以避免此浏览器缓存问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-13
    • 1970-01-01
    • 1970-01-01
    • 2017-02-08
    • 2021-04-21
    相关资源
    最近更新 更多