[TYPO3-dev] header(location:url) sends 302?
Oliver Rowlands
oliver at liquidlight.co.uk
Mon Mar 24 16:32:41 CET 2008
Hi Steffen,
PHP always outputs a 302 header by default on a 'Location:' redirect.
This will do the trick:
header('HTTP/1.x 301 Moved Permanently');
header('Location: '.$uri);
header('Connection: close');
Or if you use PHP >= 4.3 you can use:
header('Location: '.$uri, true, 301);
Best regards,
Oliver
Steffen Kamper wrote:
> Hi,
>
> in my page comments i use header(location:url);
> for the homepage link of users. The reason is that i don't want to show the
> urls on the page.
>
> Now a user contacted me about HTTP-Header is 302 and pointed me to [1]
>
> So my question: Why is 302 automatic added, and how can i change it to 301?
>
> vg Steffen
>
> [1] http://www.mattcutts.com/blog/seo-advice-discussing-302-redirects/
>
>
--
Oliver Rowlands
:: Liquid Light ::
E - oliver at liquidlight.co.uk
W - http://www.liquidlight.co.uk
T - 00 44 (0)845 6 58 88 35
F - 00 44 (0)845 6 58 44 35
More information about the TYPO3-dev
mailing list