Jump to content

index.php to redirect silently?


flemingmike

Recommended Posts

Yes, either redirect your domain to go to http://www.mysite.com/directory/index.php

 

or, add this to http://www.mysite.com/index.php

 

print "<META http-equiv='refresh' content='1;URL=http://www.mysite.com/index.php'>";

 

I have been told that some search engines penalise you for the meta tag way. Based on one of my experiences, the site I had was removed from Google soon after the redirection in that manner. Did not take it long to be reindexed on the new domain, but stilll...

 

A google ex-employee (Brother in law) told me they recommend something along the lines of this:

 

<?php
header( "HTTP/1.1 301 Moved Permanently" ); 
header( "Status: 301 Moved Permanently" ); 
header( "Location: despertn.html" ); 
exit(0);
?>

 

Where the Location points to the file, or whole url - your choice. This wont get you penalised on search engines and works great on .php files (or .htm/html if you tell them to be parsed through the php engine).

 

I am currently working on a massive site upgrade and have set a bunch of these files up to point to the newly named files and in testing it's a seamless renaming to the new page - no delay at all. Apparently it's similar to the htaccess way.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.