0

For the past 4 weeks (yes you read right, 4 weeks) I 've been trying to redirect my website to a new domain.

Here's what I want to do:

Redirect the ROOT of my website from ukmotorhomehirerental to leisurerentalsdirect.com

Without redirecting all the subfolders. ie. if I click on a link in google to one of our minor pages, I want to land on that page on the new domain without being redirected to the index page. It worth mentioning that I do want to also redirect the minor pages on a page to page basis.

I'm doing it like this (this works perfect)...

RedirectRule ^/pages/contentPage.asp\?QN=94 http://www.leisurerentalsdirect.com/pages/contentPage.asp?QN=94 [I,R=301]

However this This is were the problem lies...

RedirectRule ^/ http://www.leisurerentalsdirect.com [I,R=301]

I know the above implies to the browser that all traffic requesting ukmotorhomehirerental will be forwarded to leisurerentalsdirect

I think I need some sought of condition applying, but I just cannot understand how to do this, can anybody help?

Mat
  • 202,337
  • 40
  • 393
  • 406

1 Answers1

1

You don't actually say what the problem is, but I think you want www.ukmotorhomehirerental.com to go www.leisurerentalsdirect.com and www.ukmotorhomehirerental.com/somepage to go to www.leisurerentalsdirect.com/somepage, right?

If so, you should only need a single redirect rule:

RewriteCond %{HTTP_HOST} ^www\.ukmotorhomehirerental\.com/? [NC]
RewriteRule ^(.*)$ http://www.leisurerentalsdirect.com/$1 [L,R=301]

This will simply redirect any page on ukmotorhomhirerental.com to the same page (or root, if none) on leisurerentalsdirect.com.

  • Hello Matt, that works perfect... Thank you so much! The so called Senior Developer and Managing Director (Julian Madle) of the development company Future Shock, (who we pay a small fortune too) basically refused to help! Again thank you for getting us out of such a mess! – user2102471 Feb 26 '13 at 13:50