.htaccess is driving me mad! Help please...

Google Optimization forum discussing techniques to increase Pagerank in Google. Find Solution for beating spam pages, getting out of the sandbox, and beating the Google algorithm. Also read about the best SEO tools to help with Google search.

Moderator: derek88

.htaccess is driving me mad! Help please...

Postby irahat » Sat Sep 05, 2009 10:02 am

Hi all, I've posted something similar before but it never got resolved.

My site is dancing all over the place in the SERP's, it's more negative than positive and i am trying to resolve everything that could possibly be contributing to this, paranoia basically.

So...my site is predominantly a co.uk , i need to redirect all the .com visits to .co.uk , simple enough right? Well nothing i have tried works so far.

I also redirect all www to non-www , i have a feeling these 2 rules are somehow clashing??

Can someone please help me get this right?
irahat
FORUM ADDICT
 
Posts: 57
Joined: Sun Aug 30, 2009 10:42 am

Re: .htaccess is driving me mad! Help please...

Postby rsalan » Sat Sep 05, 2009 10:35 am

Are you referring to the domain on your signature? If so, I can see that it's redirected from www to non-wow and so I suppose you are using the following code

#Options +FollowSymlinks
RewriteEngine On
RewriteCond %{http_host} ^www.domain.co.uk
RewriteRule ^(.*) http://domain.co.uk/$1 [R=301,L]


And as for the case of your .com domain which you wanted to redirect to .co.uk

Try this code:

#Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^domain.com$
RewriteRule (.*)$ http://domain.co.uk/$1 [R=301,L]

note: just add .com domain to the same account where .co.uk domain is, and use above redirect.
rsalan
FORUM ADDICT
 
Posts: 57
Joined: Sat Sep 05, 2009 10:26 am

Re: .htaccess is driving me mad! Help please...

Postby mshah » Sat Sep 05, 2009 10:44 am

Take it you have change:
rewritecond %{http_host} ^mysite.com [nc]
rewriterule ^(.*)$ http://www.mysite.com/$1 [r=301,L]
TO
rewritecond %{http_host} ^mysite.co.uk [nc]
rewriterule ^(.*)$ http://www.mysite.co.uk/$1 [r=301,L]
as you will only need to do that bit for the .co.uk as all the .com will be directed to the .co.uk with your other code.

This may help you http://www.google.com/support/webmaster ... 3633&hl=en has a guide on redirects
mshah
FORUM ADDICT
 
Posts: 57
Joined: Sat Sep 05, 2009 10:43 am


Return to Google Optimization

Who is online

Users browsing this forum: No registered users and 0 guests