Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

How to redirect MAC users to a specific page?

What would I put in the .htaccess file to redirect



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

10+ Year Member

Quick question:

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


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

10+ Year Member

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.


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

10+ Year Member

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.


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

10+ Year Member

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.


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

10+ Year Member

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.


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 ;)


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

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member


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.



Featured Threads

Hot Threads This Week

Hot Threads This Month