Apache Tricks

Generating Apache style .htaccess redirects from Drupal's Path Redirect module

The "Path Redirect" module for Drupal 6 (http://drupal.org/project/path_redirect) is an excellent way to set up redirects from one URL to another. This module can be used for any purpose where you want the HTTP request for URL's on a Drupal website to automatically redirect to another URL. For example :-

  • you might want to have a nice URL to promote for some excellent product (example.com/excellent-camera) that lands on a merchant website while hiding the complexity of the merchant URL (making sure to include the affiliate link).

Reducing bandwidth use, decreasing page load times, for better Drupal user experience

One of my sites has a high traffic load (2000 visits per day, over 6000 page views per day) and has been using up the bandwidth allotment on the shared hosting account where it's hosted. Concerns are that a large download per page would turn off visitors due to a long page load time, and also the environmental impact of excessive bandwidth usage. Initially the only measurement tool I had was the realtime bandwidth statistics provided by the hosting provider (see the screenshots below) and it was only later when Firebug became functional on firefox 3.5 and YSlow was then usable.

Cure for FAIL when using RedirectMatch with clean URL's on Drupal

I've had a problem with use of RedirectMatch on some of my sites which causes a FAIL in combination with Drupal's reliance on mod_rewrite to provide clean URL's. Over the years I've used different technologies to build sites and on occasion have converted a site built with static web pages into one driven with Drupal. This has meant a web of .htaccess files listing redirects for the old URL into a new URL. The goal is to help your readers continue to access the pages you wrote even when the location (URL) of the page changes.