Answer the question
In order to leave comments, you need to log in
Why does the redirect from WWW not work?
There is a bunch of nginx + apache:
The final address should look like this: https://example.ru (i.e. only https, without www)
I do this:
pastebin.com/4rea3sZ6
https always works, but www remains, i.e. works both https://example.ru and https://www.example.ru, why is that?
Answer the question
In order to leave comments, you need to log in
so you don’t have a redirect from https://www.example.com
Add options to the server with the redirect to access via https.
And you can immediately change return 301 $scheme://example.ru$request_uri; on return 301 https://example.ru$request_uri;
))) I don’t see a problem with this at all, I created a .htaccess
file in the root of the site
- once
I opened the file, I wrote:
AddDefaultCharset UTF-8
RewriteEngine On
RewriteCond %{HTTP:HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]
https://example.com
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question