Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2012
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts

    .htaccess redirect for specific browser/OS combination

    I don't know if this is possible! I need to redirect if the user is accessing the site using Chrome on OS X, but not Chrome on Windows - and the same for Safari.

    Can I target, specifically, Chrome OS X and ignore Chrome Windows? I think these are the agents for the two:

    Code:
    ' Chrome, MAC OS
    ' Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.91 Safari/534.30
    
    ' Chrome, Windows 2008
    ' Mozilla/5.0 (Windows NT 6.0) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.91 Safari/534.30
    Sorry - this is pretty ignorant of me... thanks for reading!

  • #2
    New to the CF scene
    Join Date
    Jun 2012
    Posts
    7
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I have a solution from Stack Overflow and thought I'd post it here too:

    Code:
    RewriteEngine on
    RewriteCond %{HTTP_USER_AGENT} Mac\ OS\ X.*Chrome [NC,OR]
    RewriteCond %{HTTP_USER_AGENT} Mac\ OS\ X.*Safari [NC]
    RewriteRule .* http://www.redirecthere.com/ [L]


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •