Web design, programming, graphics, and pretty much anything else I care about.

mobile

Apache redirect, with cookie support

This will redirect visitors that come from various mobile devices to another website (a mobile site.) It has added support for a cookie, so that mobile users can still opt to visit the full site.

The first block checks to see if it is a mobile device and there is neither a cookie nor a url parameter set. If those conditions are met, redirect the visitor to the mobile site. The second block looks to see if the url parameter is set and there is no cookie. If those conditions are met, set a cookie for the user.