M
M
mirexdoors2019-05-10 07:52:23
Nginx
mirexdoors, 2019-05-10 07:52:23

Where else can "c www" redirects be written?

Hello!
The problem is that the rule does not work in .htaccess

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

and when accessing https://site.ru , https://www.site.ru opens
. There is a Bitrix VM on the server with the following config:
server {

    listen 80 default_server;
    server_name _;
    server_name_in_redirect on;

    proxy_set_header	X-Real-IP        $remote_addr;
    proxy_set_header	X-Forwarded-For  $proxy_add_x_forwarded_for;
    proxy_set_header	Host $host:80;

    set $proxyserver	"http://127.0.0.1:8888";
    set $docroot		"/home/bitrix/www";

    index index.php;
    root /home/bitrix/www;
    # Redirect to ssl if need
    
      server_name m-ff.ru;
        # rewrite ^(.+)$ https://m-ff.ru/$1 permanent;
      
    

    if (-f /home/bitrix/www/.htsecure) { rewrite ^(.*)$ https://$host$1 permanent; }

    # Include parameters common to all websites
    include bx/conf/bitrix.conf;

    # Include server monitoring locations
    include bx/server_monitor.conf;
  }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2019-05-10
@VladimirAndreev

nginx doesn't use htaccess, it's too slow

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question