Control Panel redirect options

Domain-based redirect

On the [host] -> [site] -> settings page you'll find a setting named Domain-based redirect. This is a very useful setting when you want to redirect all traffic to the site to one domain, or want to change the domain of the site. The Servebolt support team uses this setting when we i.e redirect from using a .no tld to .com tld.

When using the Domain-based redirect in our admin panel the redirect rule is set in nginx, which is faster and safer than setting up the redirect with .htaccess.

Http -> https redirect

The http -> https redirect feature redirects all http traffic to one address. This can very well be used in combination with the domain-based redirect feature.

Multisite configurations

Redirects with .htaccess

Multistore or multisite setups that run on multiple URLs can not use the control panel feature, because they are limited to a single domain name. 

To make all URLs redirect to the equivalent https address, add the following to .htaccess straight after RewriteEngine On: 

RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]```

Debugging redirects

  • Know what URL your application should be available on (with/without www and/or https), and check that the application is properly configured
  • Check that the control panel redirect options either are empty, or redirect to the wanted URL
  • Check that .htaccess does not contain any conflicting redirects
  • Exit and restart your browser before checking whether or not redirects work, browsers tend to cache redirects
Did this answer your question?