Z
Z
zaytseam2021-09-02 23:28:44
htaccess
zaytseam, 2021-09-02 23:28:44

Redirect from www to non-www does not work. Works only on from http to https WP.?

Hello! There was a problem redirecting to a site without www.
Tried using the REDIRECTION plugin. Specified in the plugin settings Remove www from domain and Force a redirect from HTTP to HTTPS. As a result, only a redirect from http to https works. Moreover, if I create a redirect from www.example.ru/primer to www.example.ru/eda in this plugin, then it does not work, but if I redirect from example.ru/primer to example.ru/eda, then everything is fine .
In the .htaccess file I wrote:

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.example\.ru [NC]
RewriteRule (.*) https://example.ru/$1 [L,R= 301]

The result is the same.
Tell me, please, what is the problem.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question