Redirect Entire Website without losing Google Ranks

Client has purchased a shorter version of their domain name,  old one was www.airtxinternational.com and new one is www.airtx.com

I need to redirect the entire site (apache/php) using .htacess without losing google ranks. All urls will be exactly  the same, the only thing changing is the main web address above.

Can I use a simple 301 or will I need a Mod rewrite to make sure the google ranks remain in tact?
mcpilot1Asked:
Who is Participating?
 
dfkeCommented:
301 redirects will make sure that google and other search engines know that the site has moved and will start indexing the new site from then on without losing ranks.
0
 
dfkeCommented:
For php you can use :

<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.airtx.com" );
?>
0
 
mcpilot1Author Commented:
One small issue however - my home page is an html page. The rest of the site is php. I suppose I can swap index.html for index.php since it's a basic html page, and add the php code as above?
0
 
dfkeCommented:
oh ok .htaccess.

If you run a linux server you will need the Apache Mod-Rewrite module enabled. Then you can make a .htaccess file in the root / of your site:

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.airtx.com.com/$1 [R=301,L]



0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.