I
I
Ivan Goncharenko2017-04-14 22:40:00
htaccess
Ivan Goncharenko, 2017-04-14 22:40:00

Full redirect - from HTTP to HTTPS and from WWW to non-WWW at the same time. How to set up HTACCESS Wordpress?

Hey! The situation is this - I'm doing technical optimization of the site on WordPress. I switched the site to HTTPS a week ago. I set up redirects from HTTP to HTTPS and from WWW to non-WWW (hereinafter referred to as "Full redirect").

A full redirect is done only on the main page. It doesn't work for internals. There is a redirect from HTTP to HTTPS and that's it. A full redirect of the inner pages gives whiteness. I went through several dozen code options for HTACCESS with the signatures "It worked", but it doesn't work for me.

I remember there are magic and even free plugins. I installed a couple - Easy HTTPS (SSL) Redirection, http to https forced url. Tuned and shish with oil. Problems with the redirect of internal pages remained.

Help with setting up a Full redirect. If not by code, then by a hint at the place where to dig the essence of the problem. Why does it work for the main page, but not for the rest of the pages?

How to implement: http://www. site .ru/page ---> https: //site .ru/page

Or maybe someone will say that I'm doing nonsense? Comment.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Site Developer, 2017-04-14
@lutsyi

And can someone say that I'm doing nonsense?

I will tell.
https nafik is not needed. if not billing. (a sect of believers in ranking increase and other goodies because of ssl - smoke on the sidelines, please).
The maximum that can and should be done is to hang the admin panel on ssl .
But even if he did, then protocol redirects are not needed.
We read carefully
And the rest of the VP will do everything by itself - just enter the correct addresses in the admin panel.

B
Bearax, 2017-04-14
@Bearax

In the Wordpress settings, in the Site Address field, replace http with https. If the field is inactive, then replace it in the wp-config.php file, replace it in the line

define('WP_HOME', 'http://site.ru/');
define('WP_SITEURL', 'http://site.ru/');

on the
define('WP_HOME', 'https://site.ru/');
define('WP_SITEURL', 'https://site.ru/');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question