Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-28-2012, 01:05 PM   PM User | #1
Suresure
New to the CF scene

 
Join Date: Jun 2012
Posts: 7
Thanks: 2
Thanked 0 Times in 0 Posts
Suresure is an unknown quantity at this point
.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!
Suresure is offline   Reply With Quote
Old 06-29-2012, 08:30 PM   PM User | #2
Suresure
New to the CF scene

 
Join Date: Jun 2012
Posts: 7
Thanks: 2
Thanked 0 Times in 0 Posts
Suresure is an unknown quantity at this point
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]
Suresure is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:52 AM.


Advertisement
Log in to turn off these ads.