Forum Moderators: phranque

Message Too Old, No Replies

Duplicate content and php header VS .htaccess 301

301, header, google, ban duplicate content

         

niki_man

8:30 am on Jul 6, 2005 (gmt 0)

10+ Year Member



Because of a misconfiguration and changes, one of my domains is listing three duplicate URLS for my site.

Examples of the same page:
duplicate 1 : [domain.com...]
duplicate 2 : [domain.com...]
Main page--> duplicate 3 : [domain.com...]

My site is suffering a real HARD Google Penalty now :(.

Would a redirect with the php function Header() function like a 301?

Should I use a php header function to send the duplicate pages to the main page (duplicate 3)?

Hope this is clear, it's 4:30 AM where I am...

jdMorgan

6:12 pm on Jul 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As long as you specify the correct server response header in php, the php redirect will be indistinguishable from a server-level redirect. You have to specify the redirect as a 301-Moved Permanently, otherwise you'll get a 302 redirect by default. There are several examples of the correct coding over in our PHP forum.

Jim

niki_man

4:19 am on Jul 7, 2005 (gmt 0)

10+ Year Member



Thanks I am considering this example:

<?php
// Permanent redirection
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.example.com/");
exit();
?>

Since this is very important, it worth asking if anyone disagrees with this example...?

ASP 301 technique is also mentioned

[edited by: jdMorgan at 4:26 am (utc) on July 7, 2005]
[edit reason] Removed URL per Terrms of Service. [/edit]