S
S
spieldy2016-02-26 15:50:46
htaccess
spieldy, 2016-02-26 15:50:46

Why doesn't https only work on the homepage?

The .htaccess specifies the following:

# BEGIN WordPress

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase / 
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
</IfModule>

# END WordPress

Options +FollowSymLinks 
RewriteEngine On 
RewriteCond %{HTTP_HOST} ^www.diabet-centr.ru$ [NC] 
RewriteRule ^(.*)$ https://diabet-centr.ru/$1 [R=301,L]


What could be the problem? when you enter diabet-centr.ru in the address bar, the site is displayed without https, while surfing the site https immediately works, redirection from www also works. I tried to set up a redirect from diabet-centr.ru to https://diabet-centr.ru says that a cyclic redirect was detected...

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
spieldy, 2016-02-26
@spieldy

That's how it worked)

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

D
Dim Boy, 2016-02-26
@twix007

In WordPress, you need to specify https in the settings.
https://diabet-centr.ru

V
Viktor Taran, 2016-02-26
@shambler81

You mean a redirect to without vvv and in addition, the http
places where this can be done are explicitly registered
1. vhost apache
2. nginx
3. .htaccess
4. not it but anyway, delete the second Options +FollowSymLinks
RewriteEngine On they are simply not needed, and raise it above the NC, but not above the previous Options + FollowSymLinks
RewriteEngine On
5. Your https is not correctly defined, it's better to do it this way

RewriteCond %{HTTPS} on
RewriteRule ^.*$ http://%{SERVER_NAME}%{REQUEST_URI}

Well, only in the opposite direction
5. urls on the site itself look like site.ru/page.html and not page.html
You have pure nginx+php-fpm and .htaccess does not understand redirects at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question