Hi, I'm moving to new domain, how do I redirect properly? (I really dont want to have to do it but I have no alternative). What is the best way to redirect visitors coming from google's spiders to the new pages. No changes to actual content will be made. How can I do this to minimize the damage I will suffer from Google, in diluting my pages or other things? Thanks, Zaui
<? Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: http://www.yoursite.com" ); ?> PHP:
Thanks for the HowTo tip Pedro. =) Fast response too going to make that implementation today! As for why I have to do it lets just say google doesn't like my old domain name and contacted me about it ;p No black hat stuff just in the grey zone. Zaui
What is the difference between a 301 and a 302 redirect? I'm new to seo, and have heard both mentioned but dont know the difference.
Please read the details about this on the 10.3 section here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
Thanks Chris, Had a quick skim read, seems quite technical to me, tho I'm blaming my confusion on being new to all this - I'll hopefully be able to digest it properly later. thanks
The difference between them is that a 301 redirect means that a page has permanently moved to a new location, while a 302 redirect means that a page has temporarily moved to a new location.
Hi, I've tried redirecting my site (blog) however using PHP i receive this: Header( "HTTP/1.1 301 Moved Permanently" ); Header( "Location: ".$newlocation ); exit(); 200 OK Site has moved here. (which does show the correct link) however people still need to click it. I would like this to be automatic and redirect without user involvement. Next I started trying .htaccess redirection.. I have the pretty urls enabled. So the following redirects every pages to the home page of the new blog (which sucks!) I'd like to redirect them to their corresponding posts ie. http://oldblog.com/oldpage/ -> http://newblog.com/newpage/ but what happens with the script below is: http://oldblog.com/oldpage/ -> http://newblog.com/index.php # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] RewriteRule (.*) http://newblog.com/$1 [R=301,L] </IfModule> # END WordPress any suggestions? Thanks, Zaui
I've got a redirect to work but its ugly, ideas on how to beautify it would be most welcome =) Note that I removed the [L] after index that got it to start redirecting. # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php RewriteRule ^(.*)$ http://www.newblog.com$1 [R=301,L] </IfModule> # END WordPress HERE's THE PROBLEM: http://www.oldblog.com/category/sports/ Redirects as -> http://www.newblog.com/index.php/sports/ My new urls now show an "index.php" in the address bar how do I get it to say : http://www.newblog.com/category/sports/ Thanks, Zaui
Zaui, That is a rewrite not a redirect (at least I think). Assuming you are on a unix based platform, I have always done it this way in the .htaccess file (you don't need anything before or after, just the line). Redirect 301 /oldpage/ http://newblog.com/index.php If you want to make sure that each pages' PR is passed, then you will have to do a redirect for each page. So for example Redirect 301 /oldpage1.html http://newblog.com/oldpage1.html The PR won't show up in the toolbar for a couple of months (depending obviously on the snapshot, and export timing, it could take up to 6 months ) but the juice will still pass. Morty
Hi jmort732 , Well said, however I have over 1000 html files and I'd like to do a redirect them en masse. Thanks, zaui
I know the pain all too well It really depends on how bad you want to keep your PR. You may just want to cherry pick pages and do it that way. For one massive move, I used Xenu link sleuth to crawl the current site, then copy and pasted the URLs into a spreadsheet (twice), and did some file and replace stuff to format it all. If the format change is consistent, you may be able to do something along these lines. Good luck! Morty