开发者

Cache apache mod_write and php headers

开发者 https://www.devze.com 2023-03-16 03:02 出处:网络
I\'m having a problem with php redirect (header) and mod_rewrite. Here is how: 1 - I log into the system and wait time for the session expires.

I'm having a problem with php redirect (header) and mod_rewrite.

Here is how:

1 - I log into the system and wait time for the session expires.

2 - I click a link that has any rewriting (mod_rewrite set). Ex: 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 - After that, if the user clicks again in w开发者_StackOverflowww.page.com.br/product/25/product-name.html, mod_rewrite does not rewrite to the correct file (products.php) and maintains a cache that redirects back to index.php?t=time()

comments:

This only occurs with links that need rewriting and redirection link that occurred.

Add the function time () to make sure it is a cache and no redirects successive proof is that it keeps the t = time () in clicks later

Someone had this problem, or know of some kind of cache that this mod-rewrite generating this problem?

thanks Rafael


Are you doing a 302 or a 301 redirect? 301 is "moved permanently", which means the browser will automatically go to the 'new' page, without checking for changes. If you do a 302, it's a "moved temporarily", and the browser will check if the redirect is still in effect each time.

0

精彩评论

暂无评论...
验证码 换一张
取 消