image
Blog Post • drupal

Zipcode Redirect Module

January 24, 2009by Tom Friedhof 1 min read
Blog Post • drupal
Zipcode Redirect Module
Back to top

Just finished writing a small little module called the zipcode_redirect module and you can now find it on drupal.org.  The module redirects users based on a zipcode that is entered on a site. The module provides a block with a field to enter in your zipcode and then determines the proximity of the zipcode to zipcodes you have specified in the module configuration. You can setup any number of zipcodes to check proximity against. You also add a URL for the TRUE and FALSE responses in the module settings page.

This module sets a cookie to remember your zipcode so you don't have to constantly put in a zipcode whenever you visit the site. Once you put in a zipcode, say on the front page of a site, you'll never get the "real" front page again, because it will automatically redirect you based on a cookie that was set to one of the URL's you specified on the module configuration. This module is also set up so you don't get sent into a redirect loop if configured improperly, if the block is placed on a page that was redirected to, the redirect stops and an error is sent to screen.

You can configure distance in kilometers and miles.  You can download the module here, or check out the drupal.org project page for zipcode redirect for more information or to file any bugs.

 

Authored by