Skip to content
An Django app to automatically redirect alternate hostnames to their canonical sites.
Python
Find file
Pull request Compare This branch is 1 commit ahead, 1 commit behind MidwestCommunications:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
hostname_redirects
.gitignore
README
setup.py

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.