0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Are you trying on the subdomain of some free domain providers then it should go into the subdomain only.
0
here's jonny's Avatar, Join Date: Mar 2007
Go4Expert Member
When I set my site up originally, I created a sub domain and ran it from there.
It seemed to make sense at the time.

Then I bought a new domain (domain.co.uk) and pointed it to the same files as the sub domain.

I finally bought another domain (domain.com) which reflects exactly what the site is, so I want to use that !!

So I'm looking to redirect the domain.co.uk to domain.com.

As domain.co.uk's files are in the subdomains folder, I assume that is where I need to locate the .htaccess ??

Thanks
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Quote:
Originally Posted by here's jonny
As domain.co.uk's files are in the subdomains folder, I assume that is where I need to locate the .htaccess ??
As far as I know there should be one .htaccess file in the parent folder but if its working for you in sub-domain I don't see any problem here.
0
here's jonny's Avatar, Join Date: Mar 2007
Go4Expert Member
Hi

I've tested using this :

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(test\.)?old-domain\.co\.uk$ [NC]
RewriteRule ^(.*)$ http://www.new-domain.com/$1 [R=301,L]

and it seems to work OK locating the .htaccess in the subdomains directory:

This OK for the subdomain, but now I need to consider the second domain.
Currently users access the site via:

www.2ndDomain.co.uk
2ndDomain.co.uk
www.2ndDomain.co.uk/forum
2ndDomain.co.uk/forum

How do I redirect that to the new-domain.com ? ?

Finally - I have the main domain name....
Users can access via:

sub.maindomain.co.uk
www.maindomain.co.uk
maindomain.co.uk
www.maindomain.co.uk/sub
maindomain.co.uk/sub

How do I redirect that to the new-domain.com ? ?

My aim is to get everything going to the new-domain.com...

Many Thanks
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Quote:
How do I redirect that to the new-domain.com ? ?
For both the redirects your above redirect with slight mod will work.

Just go through the following question at the SEO FAQ thread.
Quote:
Originally Posted by SEO FAQ's
Why does my website have a higher PR with the 'www' then without it?
It will redirect to non www version to the www one and then you can always add the redirect to the new domain.
0
here's jonny's Avatar, Join Date: Mar 2007
Go4Expert Member
Shabbir - Thanks

I'm sure I'll be back shortly with some more questions !!
0
here's jonny's Avatar, Join Date: Mar 2007
Go4Expert Member
I'm back.

I need to redirect domain.co.uk & www.domain.co.uk -> www.domain.com

Is this correct ?? :

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.co\.uk$ [NC]
RewriteCond %{HTTP_HOST} ^www.domain\.co\.uk$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
Then I need to make sure domain.com -> www.domain.com

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
What am I missing ??
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
I would redirect everything from domain.co.uk to www version of the new domain and not have a redirect to the www version of domain.co.uk
0
here's jonny's Avatar, Join Date: Mar 2007
Go4Expert Member
I thought that's what the examples above did !!
Is that not correct ?
0
here's jonny's Avatar, Join Date: Mar 2007
Go4Expert Member
One thing I've just noticed !!

I'm using:
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(test\.)?xxxx\.co\.uk$ [NC] 
RewriteRule ^(.*)$ http://test.aaaaa.com/$1 [R=301,L]
This redirects a subdomain of xxxx.co.uk to the new address and works well.

Except people could still visit by www.xxxx.co.uk/test or xxxx.co.uk/test
How do I stop that as well ???

Once I've got this bit and confirmed the other redirects,I'm sorted

Thanks