Redirecting based on Client User Agent

Different browsers have different capabilities, and sometimes no two browsers display the same content in the same way. It is sometimes desirable to author seperate content for each major web browser, then serve the version of a page best suited to the particular client.

match IN:User-Agent into $ with ^Mozilla.*
if matched then
  set URL = /content/index_x.htm
else
  set URL = /content/index_y.htm
endif

This rule allows different pages to be served to different browsers. For example, a more complex page could be served to Gecko-based browsers which properly support CSS, whilst a more plain page could be served to Internet Explorer (which, as far as CSS is concerned, is broken).

Note that many browsers can pretend to be Microsoft Internet Explorer or can specify a custom User Agent. This limits the effectiveness of this rule.

Content Manager [Administrator] 16 December 2005  Permalink  
Download Free Trial

Recent Articles

Other Resources



www.zeus.com