www.webdeveloper.com
Results 1 to 2 of 2

Thread: [RESOLVED] .htaccess redirect for specific browser/OS combination

  1. #1
    Join Date
    Apr 2009
    Location
    London, UK
    Posts
    34

    resolved [RESOLVED] .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. #2
    Join Date
    Apr 2009
    Location
    London, UK
    Posts
    34
    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]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles