redirect old domain to new domain

Topics: User Forum
Jun 11, 2011 at 10:15 AM

Hello everyone ,

 

I'm trying to adapt this example found here http://cheeso.members.winisp.net/Iirf21Help/html/b7a83a1c-5ae4-476b-83ef-34d2dab3c788.htm

for drupal cms, so i don't have .asp or .html files.

RewriteCond  %{HTTP_HOST}            ^(www\.)?olddomain\.co\.uk$
RedirectRule ^/(.*)$       http://www.newdomain.co.uk/$1        [R=301]

 

using Testdriver on a folder of two line + a sampleurls file, I get :

Processing URLs...(C:\iirf\tests\site\SampleUrls.txt)


NO REWRITE 'http://www.olddomain.co.uk' ==> --
ERROR expected(http://www.newdomain.co.uk)
        actual(NO REWRITE)

1 Errors in 1 Total Trials
done reading new config

 

Thanks taking time to reply

Jun 23, 2011 at 12:23 PM

Isn't it failing due to the fact that you're passing in http://www.olddomain.co.uk, rather than just www.olddomain.co.uk?

If you change the input url in your test file does it work?

I think that the HTTP_POST will only pass in the domain with any subdomains, so in your case www.olddomain.co.uk, without the http protocol showing.

Do you have this rule live or are you just testing for now to try and get it working?