Forums / National / Russian / Тех. поддержка / Редирект на HTTPS

циклическая ссылка

Kailo
#42279 2016-11-01 22:24

Во всем остальном, за исключением www. Слеш и индекс урледитором убираются. Такие директивы с ним без глюков работают:

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

#  Redirect at HTTPS without WWW 
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https://%1%{REQUEST_URI} [L,R=301]

# Prevent to load sensible data
<FilesMatch "\.(dat|tpl|inc)$">
order deny,allow
deny from all
</FilesMatch>

# Sitemap shortcut
RewriteRule ^sitemap\.xml$ index.php?r=sitemap [L]

# Admin area and message are special scripts
RewriteRule ^admin/([a-z0-9]+) admin.php?m=$1 [QSA,NC,NE,L]
RewriteRule ^(admin|login|message)(/|\?|$) $1.php [QSA,NC,NE,L]

# System category has priority over /system folder
RewriteRule ^system/?$  index.php?rwr=system [QSA,NC,NE,L]

# All the rest goes through standard rewrite gateway
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]+) index.php?rwr=$1 [QSA,NC,NE,L]

<IfModule mod_headers.c>
Header always append X-Frame-Options SAMEORIGIN
</IfModule>

А сертификат бесплатный на три года без привязки к хостингу я здесь получил https://startssl.com

This post was edited by Kailo (2016-11-02 08:56, 7 years ago)