[英]Cache apache mod_write and php headers
我遇到了 php 重定向(标题)和 mod_rewrite 的问题。
方法如下:
1 - 我登录系统并等待 session 的时间到期。
2 - 我单击一个有任何重写(mod_rewrite 集)的链接。 例如: www.page.com.br/product/25/product-name.html
3 - In implementing the above file (products.php), PHP checks that the session expired and redirects to index.php?t=time() via header ("Location").
4 - 之后,如果用户再次点击 www.page.com.br/product/25/product-name.html,mod_rewrite 不会重写到正确的文件 (products.php) 并维护一个重定向回index.php?t=time()
注释:
这只发生在需要重写的链接和发生的重定向链接中。
添加 function time () 以确保它是缓存并且没有重定向连续证明是它在点击后保持 t = time ()
有人遇到过这个问题,或者知道这个 mod-rewrite 产生了这个问题的某种缓存?
谢谢拉斐尔
你是在做 302 还是 301 重定向? 301 是“永久移动”,这意味着浏览器将自动 go 到“新”页面,而不检查更改。 如果你做了一个 302,它是一个“临时移动”,浏览器每次都会检查重定向是否仍然有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.