Re: Unable to override status code in certain installations..?
| From: | Richard Lynch | Date: | Thu, 10 Jan 2008 02:43:55 +0000 |
| Subject: | Re: Unable to override status code in certain installations..? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-266992@lists.php.net to get a copy of this message | ||
On Wed, January 9, 2008 4:35 pm, RavenWorks wrote:
> 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?
I think you are falling prey to a PHP bug.
You should be able to find it in:
http://bugs.php.net
You could also check the ChangeLogs:
http://php.net/ChangeLog-5.php
http://php.net/ChangeLog-4.php
I could be wrong, as my memory is rather vague on this one, and it's
always possible that you have similar/same symptoms with an entirely
different issue.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?