Mobile app version of vmapp.org
Login or Join
Deb1703797

: .htaccess permanent redirection with condition I want to redirect ONLY users from website1 pages to website2 homepage. The google bot and other crawlers must indexing and do not know about redirection.

@Deb1703797

Posted in: #Htaccess #Redirects

I want to redirect ONLY users from website1 pages to website2 homepage. The google bot and other crawlers must indexing and do not know about redirection. Can you help me?

I know how to place the permanent redirect, but how to add a condition to be only for users?

Edited:

I want to redirect the whole website to another one with .htaccess. The redirect must be valid only for visitors without web crawlers and bots. I want the Googlebot and other crawlers to continue indexing and viewing the old website without being redirected.

For example, if I put:

RewriteEngine on
RewriteCond %{http_host} ^www.website1.com [NC,OR]
RewriteCond %{http_host} ^website1.com [NC]
RewriteRule ^(.*)$ website2.com/ [R=301,NC,L]


In the .htaccess file, all visitors from website1 will be redirected to website2 homepage. Robots and search engines will continue to index without being redirected to website2?

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Deb1703797

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme