Forum Moderators: phranque

Message Too Old, No Replies

multiple 200 status code for same pageload

         

Wayder

3:28 pm on Feb 1, 2009 (gmt 0)

10+ Year Member Top Contributors Of The Month



I have a 302 redirect to force a maintenance page when required. When it is activated I get four status codes (302, then 200, 200 again, and then 200 yet again). All the 200 status codes are for http://www.example.com/maintenance.html

If I call the page directly I stil get multiple 200's

This is my complete .htaccess

etEnvIfNoCase Host example\.com block_access
Order Deny,Allow
Deny from env=block_access
## MY IP
Allow from 00.00.000.000

Options All -Indexes -IncludesNOEXEC
AddHandler application/x-httpd-php .html
ErrorDocument 404 /404.html
ErrorDocument 403 /403.html

RewriteEngine on

## FORCE REDIRECT TO MAINTENANCE PAGE
#RewriteCond %{TIME_YEAR}%{TIME_MON}%{TIME_DAY}%{TIME_HOUR}%{TIME_MIN} >200902010653
RewriteCond %{REQUEST_URI} !^/maintenance\.html$
#RewriteCond %{REMOTE_ADDR} !^00\.00\.000\.000$
RewriteRule (.*) http://www.example.com/maintenance.html [R=302,L]

Shouldn't I only be getting one 200 status code?
If so, can anyone see where my mistake is?

Thanks

Ray...

jdMorgan

7:43 pm on Feb 1, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not clear...

A couple of questions:

Do you mean that you see four separate HTTP client request/server response transactions, with a response code of 302, 200, 200, and 200 in that order? Or do you mean that while watching the HTTP transactions you see an intial client request, a server response of 302-Found, a second client request for that new URL, and then a server response with three 200-OK status lines in it? Or some combination or permutation of this?

Frankly, it sounds like a scripting error, since the basic server isn't going to issue multiple status headers or multiple response to the same request...

Jim

Wayder

8:18 pm on Feb 1, 2009 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hi Jim,

I am using Live HTTPheaders to see the response and I see four separate HTTP client request/server responses, with a response code of 302, 200, 200, and 200 in that order.

The problem can't come from the /maintenance page because it's only HTML.

---START---
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Maintenance Page</title>
</head>

<body>
<h1>Maintenance Page</h1>
</body>
</html>
---END---

I removed everything else from the .htaccess because I thought that something else could be interfering but no change.

When I disable the redirect I get the correct single 200 server response.

-ADDED-
I have been experimenting and I have been using the firefox webdeveloper toolbar with cache disabled. I re-enabled cache and I get a single 200 response now.

<SheepishGrin>Sorry to waste your time, I do appreciate your help though </SheepishGrin>.

Ray...

jdMorgan

9:14 pm on Feb 1, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey, don't worry about -- I always try to remind members about disabling the cache when changing server side code... But I forgot! (And I often forget when testing my own stuff, too!) :)

Jim