How to manage redirects in Aldryn Django applications#
Divio applications are HTTPS-ready by default, and we provide free SSL certificates on all applications.
To force redirect from HTTP to HTTPS in Django, set the SECURE_SSL_REDIRECT
environment variable to
Domain name redirects#
You can set up your site’s domains using the domains section of the Control Panel. This includes the ability
to set a primary and secondary domains. The secondary domains can each be set to redirect to the primary domain if
required. You can enable / disable redirects from the three dots menu which will automatically populate
Domain redirects/aliases can also be managed manually, via DOMAIN_REDIRECTS /
DOMAIN_ALIASES in the
env variables section of the Control Panel. The list of domains is comma-separated. Note that doing this overrides
all settings applied in the Control Panel - so if you use
DOMAIN_REDIRECTS, you will need to list all the
domains there yourself.
Refer to domain settings and environment variables for more information.
Django provides redirection to the the default language URL when none is specified. (In addition, django CMS offers complex fallback options for unavailable languages.)
/about will redirect to
/en/about if English is the
aldryn-django can be configured to not use the prefix for the default language, by checking the Remove URL language prefix for default language checkbox on the settings for the Aldryn Django addon in the Control Panel.