HenryC Posted June 13, 2011 Share Posted June 13, 2011 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.. Quote Link to comment https://forums.phpfreaks.com/topic/239185-redirect-problem/ Share on other sites More sharing options...
Fadion Posted June 13, 2011 Share Posted June 13, 2011 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 ) version <?php header('Location: http://www.yournewsite.com/', true, 301); ?> Quote Link to comment https://forums.phpfreaks.com/topic/239185-redirect-problem/#findComment-1228926 Share on other sites More sharing options...
HenryC Posted June 13, 2011 Author Share Posted June 13, 2011 still keeps the .co.nr domain in the address bar Quote Link to comment https://forums.phpfreaks.com/topic/239185-redirect-problem/#findComment-1228956 Share on other sites More sharing options...
runnerjp Posted June 13, 2011 Share Posted June 13, 2011 Have you tried using javascrpt function redirect(){ window.location.href = "http://yourwebsite/"; } Quote Link to comment https://forums.phpfreaks.com/topic/239185-redirect-problem/#findComment-1229028 Share on other sites More sharing options...
HenryC Posted June 14, 2011 Author Share Posted June 14, 2011 same result. Quote Link to comment https://forums.phpfreaks.com/topic/239185-redirect-problem/#findComment-1229357 Share on other sites More sharing options...
sstangle73 Posted June 14, 2011 Share Posted June 14, 2011 use an html meta refresh? <meta http-equiv="refresh" content="0;url=http://newurl.com/"> Quote Link to comment https://forums.phpfreaks.com/topic/239185-redirect-problem/#findComment-1229360 Share on other sites More sharing options...
michael1291 Posted June 14, 2011 Share Posted June 14, 2011 This may not be what your looking for but could you not just use your .htaccess file to permanently redirect your old domain to your new domain therefore anyone trying to access for example http://www.olddomain.com would be redirected to http://www.newdomain.com. Quote Link to comment https://forums.phpfreaks.com/topic/239185-redirect-problem/#findComment-1229696 Share on other sites More sharing options...
redixx Posted June 14, 2011 Share Posted June 14, 2011 Does the free domain have some sort of URL masking enabled? Quote Link to comment https://forums.phpfreaks.com/topic/239185-redirect-problem/#findComment-1229699 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.