For Programmers: Free Programming Magazines  


Home > Archive > PHP on Windows > February 2005 > IIS PHP 301 Redirect









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author IIS PHP 301 Redirect
Emmerse

2005-02-24, 3:56 am

Hi,
I am having problem with PHP header location with IIS 6.0. Even after i sent
the

header("HTTP/1.1 301 Moved Permanently");

the

header (Location: url);

always return 302 redirect.


any solution to this problem?

Thanks.

Jack Sen
Unknown W. Brackets

2005-02-24, 3:56 am

Jack Sen,

Order may matter (depending on PHP version) - try sending the Status
after the Location.

Are you sure PHP is outputting the right headers? The easiest way to
find out is to use the cgi version of PHP (php-cgi.exe or php.exe
depending on your version of PHP) so you can see the outputted headers.

You may also try naming the file "nph-filename.php" and then accessing
it as such. If you are using CGI, this tells IIS to leave the headers
alone and send them as they should be.

If you are currently using CGI, you may also wish to look into switching
to ISAPI if at all possible, as it is more efficient.

Regardless, it seems to work fine for me using PHP 5 and Apache.

-[Unknown]

-------- Original Message --------

> Hi,
> I am having problem with PHP header location with IIS 6.0. Even after i sent
> the
>
> header("HTTP/1.1 301 Moved Permanently");
>
> the
>
> header (Location: url);
>
> always return 302 redirect.
>
>
> any solution to this problem?
>
> Thanks.
>
> Jack Sen

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com