Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8685383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:33:24+00:00 2026-06-12T22:33:24+00:00

I need help in .httaccess rewrite rule. One of my client says A website

  • 0

I need help in .httaccess rewrite rule. One of my client says “A website abc.com should send traffic (with 301 redirect) from google, bing and yahoo search engigne bots only to cba.com otherwise show index.html (its a white page) i.e if Google robot is crawling abc.com it should see a redirect to bcd.com instead of the real content”.

is this possible like this?

RewriteEngine On 
RewriteCond %{HTTP_USER_AGENT} Googlebot [OR]
RewriteCond %{HTTP_USER_AGENT} msnbot [OR]
RewriteCond %{HTTP_USER_AGENT} Slurp
RewriteRule ^(.*)$ http://bcd.com/$1 [L,R=301]

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:33:25+00:00Added an answer on June 12, 2026 at 10:33 pm

    You can get a list of user agents here: http://www.user-agents.org/

    But what you have should work. You could add an additional check for the hostname:

    RewriteEngine On 
    RewriteCond %{HTTP_HOST} abc.com$ [NC]
    RewriteCond %{HTTP_USER_AGENT} Googlebot [OR]
    RewriteCond %{HTTP_USER_AGENT} msnbot [OR]
    RewriteCond %{HTTP_USER_AGENT} Slurp
    RewriteRule ^(.*)$ http://bcd.com/$1 [L,R=301]
    

    Those rules work for me in a blank htaccess file. This is my request:

    GET /something HTTP/1.1
    Host: abc.com
    User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; http://www.google.com/bot.html)  
    

    And this is apache’s response:

    HTTP/1.1 301 Moved Permanently
    Date: Mon, 15 Oct 2012 22:10:55 GMT
    Server: Apache
    Location: http://bcd.com/something
    Content-Length: 289
    Content-Type: text/html; charset=iso-8859-1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help regarding .htaccess rewrite rule. One of my page have combination
I need help to redirect the following URL (in htaccess) http:www.domain.com/article/the-bp-oil-spill-one-year-later/19918396/20110420/ To http:www.domain.com/article/the-bp-oil-spill-one-year-later/19918396/2011/04/20/ my
I have one folder named test located at www.mydomain.com/abc/files/test. I need to change the
need help to create regular expression matching string www.*.abc.*/somestring Here * is wild card
I'm new to htaccess usage... need help on the below Form http://mysite.com/index.php?page=login to http://mysite.com/login
Can anyone help with .htaccess URL rewriting rule. I need to redirect pages like
I need a little help on this one. I'm in the process of making
Need Help, I want create an image access caching, example image at url example.com/caching/m_images.jpg
Greetings all, I need help combining some htaccess rewrites, these crazy regular expressions screw
I need a little help with my .htaccess before I deploy it! I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.