Login

Tag "permanent"

Snippet List

PermanentRedirectMiddleware

This is a simple middleware that redirects the exactly URL requested with the correct domain. It is useful when you have more than one domain (most of cases with "www." or IP) to access a website. To make it works, download the snippet file as the name "permanent_redirect.py" and add its path as the first item in MIDDLEWARE_CLASSES setting in settings.py. Later you must inform a setting called `HTTP_HOST_DOMAIN` with the correct domain.

  • middleware
  • redirect
  • permanent
  • seo
Read More

1 snippet posted so far.