Forum Moderators: coopster

Message Too Old, No Replies

PHP advice on 301 redirect

using php code to redirect domains

         

phochief

5:58 am on Mar 5, 2006 (gmt 0)

10+ Year Member



I have some domain names registered at GoDaddy and one free hosting account there on a Linux shared server. I needed a way to 301 redirect these domain names to my main domain name at my Yahoo store.

According to GoDaddy tech support, I can't access the .htaccess file, and the only way I can do a 301 redirect is using php code :

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: [mymaindomain.com...]
exit();
?>

I put the above code into an index.php file and placed it in the root directory of my free host server. This seems to work well, but I'm wondering if I should have named the file something else? I mean, index.php seems to work, but I don't know php.

Thanks for any advice.

Anyango

6:39 am on Mar 5, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



nopes, no need to change file name. you ve already done it correct.

phochief

7:26 am on Mar 5, 2006 (gmt 0)

10+ Year Member



Great....thanks!