Redirect Domain htaccess


#1

I’m trying to redirect my old domain to its new domian. I have figured out that the default method of a html refresh page is very bad for SEO.

So I’m doing my redirect with my .htaccess file.
Which works fine if I type in the domain directly however the old links don’t get reformatted correctly.

Here is my .htacess file
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^timeandactionproductions.com
RewriteRule ^(.*)$ http://www.timeandactionproductions.com/$1 [R=permanent,L]

For example

http://www.tandaproductions.net/contact-us/index.php

becomes

http://www.timeandactionproductions.comcontact-us/index.php

Any Idea how I can fix the new url?


#2

Well the problem appears to be that you don’t have a one-to-one mapping of URL space from

www.tandaproductions.net to www.timeandactionproductions.com

This means you need to catalog the pages and the old URL and the new URL:

Home
Old: /
New: /

Contact Us
Old: /contact-us/index.php
New: /contact-us.html

And then use a rule set like so:

[code]RewriteEngine on

if the domain is the new domain …

RewriteCond %{HTTP_HOST} timeandactionproductions.com

then skip N rules (2 so far) …

RewriteRule .* - [skip=2]

The next N rules map old to new …

RewriteRule ^$ http://www.timeandactionproductions.com/ [R=permanent,L]
RewriteRule ^contact-us/index.php $ http://www.timeandactionproductions.com/contact-us.html [R=permanent,L][/code]
:cool: openvein.org -//- One-time [color=#6600CC]$50.00 discount[/color] on [color=#0000CC]DreamHost[/color] plans: Use ATROPOS7