Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bader rashed

macrumors newbie
Original poster
Nov 6, 2010
2
0
Above all .. thanks for this wonderful website ...

and ,, i have website for free softwares

it has 2 section one for mac software and the second for windows softwares ,,

i want do like .. www.download.com

if the visitor has Mac i want automatically redirect to section for mac softwares ..

if the visitor has windows i want automatically redirect to section for windows softwares ..

i hope found the correct way here .. because i've search a lot in google but i don't found it there ..


thanks ...
 
Several headers are generally sent with each web request. One of these is called User-Agent. That will tell you if the browser is on a Mac or PC.

Example

User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12

Visit

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

for more information

If you're wanting to send a redirect to the browser, you can send a 302 response code with the new url.
 
Last edited:
Several headers are generally sent with each web request. One of these is called User-Agent. That will tell you if the browser is on a Mac or PC.

Example

User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12

Visit

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

for more information

If you're wanting to send a redirect to the browser, you can send a 302 response code with the new url.

thank you bbarnhart ...

I read a lot about User-Agent ... but really i dont understand :eek:

so what is the code can i write it to redirect mac user to specificity page


thank you
 
Above all .. thanks for this wonderful website ...

and ,, i have website for free softwares

it has 2 section one for mac software and the second for windows softwares ,,

i want do like .. www.download.com

if the visitor has Mac i want automatically redirect to section for mac softwares ..

if the visitor has windows i want automatically redirect to section for windows softwares ..
Just because a visitor is using a Mac doesn't mean they want to go to the Mac section, same for those using Windows. Consider setting a cookie when they go to one section or the other and return them to the same section next time they visit.

--
Rob
 
Just because a visitor is using a Mac doesn't mean they want to go to the Mac section, same for those using Windows. Consider setting a cookie when they go to one section or the other and return them to the same section next time they visit.

Yep. Or making the Mac link (or PC link) nice and big and prominent, "we think this is the link you want", but still offer the other link somewhere just below it just in case. Or present it as a list/drop-down of choices, but move their user-agent platform to the top of the list.

bader_rashed, what language are you coding this in?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.