homepage Welcome to WebmasterWorld Guest from 54.198.130.203
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
How to redirect MAC users to a specific page?
What would I put in the .htaccess file to redirect
RobbieD




msg:1504313
 9:33 pm on Mar 6, 2004 (gmt 0)

Quick question:

How would I redirect all MAC user to an alternative home page using .htaccess (mod rewrite)

 

jonknee




msg:1504314
 9:34 pm on Mar 6, 2004 (gmt 0)

Just a nitpick, but it's Mac. MAC is actually a hardware address for network devices...

You could probably do it with the user agent, though it is probably easier to do via something like PHP.

RobbieD




msg:1504315
 9:37 pm on Mar 6, 2004 (gmt 0)

Oh thanks for the tidbit :)

Would there be a way to just use a line in a .htaccess file for the home page? I think I read somewhere that you would redirect users to alternative pages given their OS, Browser etc.

I would like all Mac users to go to the Mac home page at our site and need to know how this can be done using .htaccess.

We are already using mod_rewrite to send users to cgi type pages when they go to a static directory.

RobbieD




msg:1504316
 9:45 pm on Mar 6, 2004 (gmt 0)

Here is a good example of what we would like to do using .htaccess or another easy way...

BuyMusic is now redirecting Mac users to a page that indicates users must be running Windows and Internet Explorer to access the site.

jonknee




msg:1504317
 12:28 am on Mar 7, 2004 (gmt 0)

And they probably are doing it via ASP / JSP (whatever they are using). It's not hard to do in a scripting language.

But, if you just code a standards compliant site, you don't need to redirect based on OS.

dcrombie




msg:1504318
 12:17 pm on Mar 8, 2004 (gmt 0)

BuyMusic is using JavaScript browser detection (slightly broken and about 10 times longer than needed) to stop Mac users, Netscape and Opera users and anyone using IE<5.0 from accessing the site.

It's pretty pathetic IMHO for a site to only work in one browser ;)

jdMorgan




msg:1504319
 1:35 am on Mar 15, 2004 (gmt 0)

RobbieD,

You can use .htaccess to redirect based on the user-agent (browser) name, but not on the OS. The browser generally supplies its user-agent name with each request that it makes, but it does not usually send any OS information. However, as stated above, the OS information *is* accessible using a client-side script, such as JavaScript.

I do agree that a standards-compliant site has no need of such work-arounds, but I hope that helps.

Jim

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved