How to set up redirect to HTTPS

In Site app settings or via file .htaccess

You can set up redirect to HTTPS only if you have an SSL certificate installed for your domain name. Auto redirect converts indexed HTTP links to your website to HTTPS links. It is useful for correct indexing of a website by search engines and for secure use of a website by its visitors.

Redirect to HTTPS for entire website

  1. Log into your Webasyst backend at an HTTPS URL; e.g.:

    https://mydomain.com/webasyst/    
  2. Open Site app.
  3. In the top-left corner select a domain name with an SSL certificate installed.
  4. Open “Settings” section.
  5. Enable option “Redirect to HTTPS” and save settings.

Upon saving the settings, redirect to HTTPS with server response code 301 will be enabled for entire selected website.

Redirect to HTTPS for selected website sections

  1. Log into your Webasyst backend at an HTTPS URL; e.g.:

    https://mydomain.com/webasyst/    
  2. Open Site app.
  3. In the top-left corner select a domain name with an SSL certificate installed.
  4. Open “Structure” section.

  5. Select the site section (settlement) for which you want to enable the redirect to HTTPS.
  6. Enable option “Redirect to HTTPS” in settlement properties and save them.

Upon saving the settings, redirect to HTTPS with server response code 301 will be enabled for a selected website settlement only.

Custom redirects

When you use “Redirect to HTTPS” settings described above, redirects are performed by a PHP script, which returns to a client software, browser or search crawler, server response code 301.

If you want redirects to work differently; e.g., if redirects should be executed by a web server rather than by PHP code, or if a different server response code must be returned to client software, or if you want to disable redirects for selected URLs, then do not use Site app settings and set up redirects in your web server configuration.

View a simple example of HTTPS redirect setup for web server Apache

In file .htaccess extend line

RewriteEngine On

with extra commands shown below

RewriteEngine On

RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

They will work only if your web server accepts instructions for mod_rewrite module of Apache web server. To enable such a redirect for other web servers, different setup may be required.

0 comments

    Posting new comments is disabled for this topic.


    Раздел помощи работает на основе приложения «Хаб»