bill110 Posted April 5, 2007 Posted April 5, 2007 After adding a SEF url contribution all works ok except that google now has the same page indexed with the extension .php and .html both ways can reach the same page when clicked but I do not want to be penalised for duplicate content. How can I write a 301 redirect to have google redirect from the .php page and see it as the .html page? My Contributions Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly Password Protect Admin "No matter where you go....There you are" - Buccaroo Bonsai
smithygotlost Posted April 5, 2007 Posted April 5, 2007 well personally i would send the html to the php as the php file is what makes the car run ! in your index.html if you take all the code out a replace with <html> <head> <title>Redirect</title> <meta http-equiv="Refresh" content="5;URL=index.php" /> </head> <body> Please Wait You Are Being Redirected </body> </html> Or in the index.php ( Not recommended ) <html> <head> <title>Redirect</title> <meta http-equiv="Refresh" content="5;URL=index.html" /> </head> <body> Please Wait You Are Being Redirected </body> </html> Does that help ?
bill110 Posted April 5, 2007 Author Posted April 5, 2007 Actually its the same page with the url rewritten with mod rewrite in the .htaccess file to be more search engine friendly. None of the code in the pages has changed It just no longer has question marks etc.. in the url My Contributions Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly Password Protect Admin "No matter where you go....There you are" - Buccaroo Bonsai
commercer Posted April 5, 2007 Posted April 5, 2007 In the file index.php, try with this code. <?php if(eregi('index.html',$_SERVER['REQUEST_URI)){ header( "HTTP/1.1 301 Moved Permanently" ); header( "Location: http://www.NEW-DIRECTION.com" ); } ?> Or with apache, in .htacces file: redirect 301 /index.php http://www.NEW-DIRECTION.com/index.html
bill110 Posted April 5, 2007 Author Posted April 5, 2007 Since the category pages change dynamically the urls would now read http://mysite.com/widgets/index.html the next one will read http://mysite.com/gadgets/index.html Same on product_Info pages. I will try this but I think I may need to place a code in the application _top to do the redirects as you would if google had indexed pages with the SID My Contributions Stylesheet With Descriptions Glassy Grey Boxtops Our Products Meta Tags On The Fly Password Protect Admin "No matter where you go....There you are" - Buccaroo Bonsai
Recommended Posts
Archived
This topic is now archived and is closed to further replies.