CityHost.UA
Help and support

How to configure redirection to https?

In the control panel, the function of automatic redirection to HTTPS protocol is implemented at the level of the NGINX web server, which you can enable by going to the SSL certificate management settings - [instructions] and opposite the [Redirect to HTTPS] item, set the value to [Enabled]:

If you need to manually configure the redirection of all requests from http to https, you just need to add the following rule to the .htaccess file located [in the root directory of the site] :

 RewriteEngine On RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

If you need to configure redirection for all site URLs from http to https, except, for example, the directory / cityhost / (disable redirection for URL: domain_name.zone/cityhost/), you just need the .htaccess file located [in the root directory of the site] add the following rule:

 RewriteEngine On RewriteCond %{HTTPS} off RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteCond %{REQUEST_URI} ^/cityhost/$ RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

For quick access to the .htaccess file and its editing, you can use [file manager]