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


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.

Drupal cookie domain

$cookie_domain = 'david.narrabilis.com';

Must be set in settings.php for FCKEditor's (CKEditor) file manager to work. Otherwise, you get a pop up error when you try to access it via the "Bowse Server" button. Like when trying to insert an image. Also, if this setting is incorrect, it can cause various things on a Drupal site to not work. For example, I could not log in to an otherwise functional site. When I tried to install another, with this misconfigured, the installation failed half way through with some mysql syntax error.