C
C
Christina2018-10-02 20:28:18
htaccess
Christina, 2018-10-02 20:28:18

Why does the redirect to https work only on the main page?

It works on the main one, but not on the internal ones. Where to dig, tell me.

php_flag session.use_trans_sid Off
RewriteEngine on
******** Этот код по рекомендации хостинга spaceweb*****************
SetEnvIf X-Forwarded-Proto https SERVER_PORT=443
SetEnvIf X-Forwarded-Proto https HTTPS=on
RewriteCond %{HTTP:HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
***************************************************************************************
Options +FollowSymLinks
RewriteRule ^index.php - [L]
RewriteCond %{REQUEST_URI} !^/_img/
RewriteCond %{REQUEST_URI} !^/_scripts/
RewriteCond %{REQUEST_URI} !^/admin
RewriteCond %{REQUEST_URI} !^/download/
RewriteRule !\.(gif|jpg|css|ico)$ /index.php [L]
#php_flag  display_errors        on
php_value error_reporting        8191
<Files admin/index.php>
Order Deny,Allow
Allow from all
</Files>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-10-02
@AleksandrB

Don't worry and change to

RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

or
RewriteEngine On
RewriteCond %{HTTPS} =off 
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question