Link to home
Start Free TrialLog in
Avatar of mcpilot1
mcpilot1

asked on

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?
ASKER CERTIFIED SOLUTION
Avatar of dfke
dfke

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dfke
dfke

For php you can use :

<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.airtx.com" );
?>
Avatar of mcpilot1

ASKER

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?
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]