skip to Main Content

I am essentialy trying to cloak Google certain pages on my site to another. Reason being is i am using this site for paid traffic but i wish to send the SEO traffic elsewhere (via a 301 redirection) as the conversions will be better.

Anyway here is the htaccess i have written so far but i dont know how to add multiple pages.

RewriteEngine On 
RewriteCond %{HTTP_HOST} http://www.currentsite.com/ [NC]
RewriteCond %{HTTP_HOST} http://www.currentsite.com/page1 [NC]
RewriteCond %{HTTP_USER_AGENT} Googlebot
RewriteRule ^(.*)$ http://www.newsite.com/ [L,R=301]
RewriteRule ^(.*)$ http://www.newsite.com/page1 [L,R=301]

I assume you can see what i am trying to achieve, redirecting page1 to page1 etc.

Thanks

Morgan

2

Answers


  1. Create a robots.txt in your main folder with this content:

    User-agent: *
    Disallow: /page_to_hide1
    Disallow: /page_to_hide2
    Disallow: /page_to_hide3
    

    Find more information here:
    https://support.google.com/webmasters/answer/6062608?hl=en http://www.robotstxt.org/robotstxt.html

    Login or Signup to reply.
  2. RewriteCond work only with the first RewriteRule just after. You can use:

    RewriteEngine On 
    RewriteCond %{HTTP_HOST} http://www.currentsite.com/ [NC]
    RewriteCond %{HTTP_USER_AGENT} Googlebot
    RewriteRule ^(page1|page2|page3|etc)$ http://www.newsite.com/$1 [L,R=301]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search