Unable to override status code in certain installations..?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I'm currently trying to create a system where a custom 404 ErrorDocument in
PHP is able to 301 Redirect the browser in certain cases. This works fine on
some servers, however, on some other servers the PHP script seems to be
unable to replace the 404 header.

Correctly overrides with '200' status:
http://fidelfilms.ca/redirectTest/

Unable to override default '404' status:
http://fraticelli.info/redirectTest/

Those two pages will look the same in a browser window, but one returns 404
and one returns 200 (as it should, because of the header() call) -- check
with whatever browser plugin you prefer for reading HTTP headers, such as
Live HTTP Headers for Firefox.

Returning the correct status code is important because we're migrating a
site from one domain to another, and we don't want to lose ranking in search
engines. (In the examples above, I return 200 as a test, but in practice
this will be used to 301 all visitors -- and search engines -- to the new
domain.)

My question is this: What causes PHP to be able to override the
ErrorDocument status on some servers and not others? Is it caused by PHP's
behavior or Apache? Is this a configurable option, or was the behavior
permanently changed in a given version of either?
-- 
View this message in context: http://www.nabble.com/Unable-to-override-status-code-in-certain-installations..--tp14723283p14723283.html
Sent from the PHP - General mailing list archive at Nabble.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux