Jump to content

Redirect Problem


HenryC

Recommended Posts

I have a co.nr domain which is a free domain pointed at my site, now i have a real .com domain i have put a message on the old one with a link to the new website, now when i click the link on that page and it takes me to the new site the address bar still says .co.nr when i am on my new domain, is there anyway i could use another method of redirect to force the new domain, i have tried header, meta, htacces..

Link to comment
https://forums.phpfreaks.com/topic/239185-redirect-problem/
Share on other sites

A 301 header and a redirect would do the job perfectly. Just create a blank .php file in your old website and write:

 

<?php
header('HTTP/1.0 301 Moved Permanently'); 
header('Location: http://www.yournewsite.com/'); 
?>

 

or the shorter (by 1 line :shy:) version

<?php
header('Location: http://www.yournewsite.com/', true, 301); 
?>

Link to comment
https://forums.phpfreaks.com/topic/239185-redirect-problem/#findComment-1228926
Share on other sites

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.