Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
An Django app to automatically redirect alternate hostnames to their canonical sites.
Python
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
hostname_redirects
.gitignore
README

README

An app to automatically redirect alternate hostnames to their canonical
sites. Developed for a dynamic-multitenancy implementation, but could be
useful otherwise as well.


USAGE:
- Add the middleware to the top of your middleware list (so it is
  processed first at request time).
- Add redirects to your actual sites from their alternate domain names.


OPTIONAL FEATURES:
- Set CATCHALL_REDIRECT_HOSTNAME='example.com' to automatically redirect
  unknown hostnames to that site. (optional)
- Set REMOVE_WWW=True to remove "www." from the beginning of hostnames
  and redirect (opposite of PREPEND_WWW). (optional)
Something went wrong with that request. Please try again.