1

How i can do this, opera and firefox visitors automatically redirect on my subdomain? Example my domain is www.site.com i want when visitor come to my website with opera and firefox, automatically redirect on www.sub.site.com

Thanks

John
  • 11
  • 1
  • Possible duplicate of [.htaccess Redirect to specific webpage based on browser](http://stackoverflow.com/questions/14057575/htaccess-redirect-to-specific-webpage-based-on-browser) – Vukašin Manojlović Feb 20 '16 at 10:47

1 Answers1

0

You can do a http_user_agent based redirection using htaccess.

Try the following code in Root/.htaccess :

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?mainsite.com$
RewriteCond %{HTTP_USER_AGENT} (opera|firebox) [NC]

RewriteRule ^(.*)$ http://sub.site.com/$1 [NC,L,R]

This will redirect opera or firebox user_agents from mainsite to subdomain.

Amit Verma
  • 40,709
  • 21
  • 93
  • 115