| 8:36 pm on Jul 11, 2012 (gmt 0)|
Redirect status is cacheable.
Properly delete/clear the browser cache before retesting.
The canonical URL for the root page ends with a trailing slash.
Use example.com in this forum.
| 2:23 pm on Jul 12, 2012 (gmt 0)|
Thanks - as I said though, the problem continues even after I clear my browser cache...
| 4:26 pm on Jul 12, 2012 (gmt 0)|
I didn't figure this out, but once I finalized my script, I just changed the variable name to ensure fresh values when processing. It works fine, so unless someone sees some underlying issue, I'll assume it's resolved.
| 4:39 pm on Jul 12, 2012 (gmt 0)|
Hmm... I've had similar problems with Firefox and clearing the browsing history rather than the cache seems to correct it.
| 1:17 pm on Jul 28, 2012 (gmt 0)|
Thanks rlange - I ran into this problem again today and changing the page name wasn't an option; clearing the cache didn't work, but clearing history did. NOTE FOR IE USERS: be sure to UNcheck 'Preserve Favorites website data in the delete history dialog; it didn't work until I did that.
Seems to me this is a browser bug. If a URL delivers a 'page not found' error, why does the browser repeat the error even when the page has been added and the URL is now valid?
Is there an issue with my HTTP response code as indicated in my first post? As I said, I changed it from '301' to '307', but it still seems to glitch.
| 7:25 pm on Jul 28, 2012 (gmt 0)|
The 307 is temporary, I'm sure that 301 is what you really require.
| 8:22 pm on Jul 28, 2012 (gmt 0)|
So why doesn't the browser update when the HTTP status changes?
| 8:48 pm on Jul 28, 2012 (gmt 0)|
Even though it is "temporary", the response is still cacheable.
| 11:02 am on Jul 29, 2012 (gmt 0)|
So I should just go with the 301 and if users get a rare page error (say, my server's down or I remove a page then put it back), they're stuck with it until they clear their cache?
| 2:19 pm on Jul 31, 2012 (gmt 0)|
|Is there an issue with my HTTP response code as indicated in my first post? As I said, I changed it from '301' to '307', but it still seems to glitch. |
Huh... A 307 should cause compliant browsers to keep checking the original URL, which means they should get the redirect destination every time. The only thing I can suggest is to check the response headers your server is sending (I use the "Live HTTP Headers" extension for Firefox). If your server is telling browsers that your 307 redirect can be cached, they'll cache it.
| 5:01 pm on Jul 31, 2012 (gmt 0)|
Thanks, I'll look into that.
| 7:58 pm on Jul 31, 2012 (gmt 0)|
will work to fix recent FF5/IE9 issues with redirects. The browsers call this a speed implementation (and they are correct), but this issue has wreaked havoc on older sites not setting the cache to ignore the response.
This has fixed a few redirect issues I've seen recently.
| 9:42 pm on Jul 31, 2012 (gmt 0)|
That looks like what I need. I'll be using it in error processing, so do I put that atop my error page so that the page doesn't keep showing up once the URL becomes valid?
| 1:39 am on Aug 1, 2012 (gmt 0)|
All headers need to be sent before any output to the browser... this includes spaces before the <? in the start of a PHP document or any print/echo commands or any PHP errors sent to the screen. Headers come first.
This is similar to an HTML doc with the 'head' section coming before the 'body' section.
The top is an excellent place to add cache-control headers, but be very certain that there is no output to the browser before the headers are sent or it may generate an error (white screen).
If a page redirects somewhere (possibly in the future), it needs to send the cache control headers before issuing a redirect status of 3xx. Otherwise the redirect may be permanently cached in the newer browsers, even if the page returns later.
If you still experience an issue immediately after implementing this, this is normal with a 'tainted browser'. Clear your cookies and cache, then try the page again. It will no longer be cached in your browser and will no longer be cached in fresh browsers visiting your site.
| 6:20 pm on Aug 1, 2012 (gmt 0)|
|If a page redirects somewhere (possibly in the future), it needs to send the cache control headers before issuing a redirect status of 3xx. |
So rather than putting atop the error display page, I should add it to my error processing page, immediately before I redirect to the display page? Like so:
header( "Location: http://example.com/error_display.php', '', 301 );