Hi I run a large social network and i am changing its domain. But i wont all the the links that point to the current domain to work ( there are lots ) So i am wanting to know how best to do it in terms so the search engines pass all over my current rankings from my old domain to my new on. here is an example of what i need to do. www.olddomain.co.uk/username i need that to divert to www.newdomain.com/username with out having to list very user and page in my old site hope i am explaining it properly. Thanks
I'm not a search engine pro, but as far as I know, most spiders/robots hate redirects. I'v always kept the old domain for a few more months with just a simple link stating the page has moved. It has always worked pretty well for me.
Not if it is done right 301 redirects are designed for this type of thing simply putting a link up is not going to work we have over 40,000 members we need to do a redirect its just finding out which way best to do it
ohh alright.. Well, i found a webpage that might be of help for you: http://www.webconfs.com/how-to-redirect-a-webpage.php
//also take note of the $_SERVER['QUERY_STRING']; as it will return the a=5&id=4 vars. $fulluri = 'http://www.new-url.com'. $_SERVER['REQUEST_URI']; header( "HTTP/1.1 301 Moved Permanently" ); header( $fulluri ); exit; PHP:
htaccess is more secure. The php redirect may not always work depending on the browser and browser settings. Use htaccess.
For your situation I would have Apache (htaccess) do it. Apache and PHP are doing pretty much the same thing to issue the redirect. however, doing it with PHP is like getting out of your car, walking through the house and into the garage then opening the garage door from inside instead of just clicking the remote opener clipped to your sun visor.
Thanks I think i will go with the htaccess then any tips on what we need to put in the htaccess file. Thanks
.htaccess RewriteEngine On RewriteCond %{HTTP_HOST} www.olddomain.co.uk RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L] Code (markup):