S
S
SpectreZ2021-04-29 09:52:11
Nginx
SpectreZ, 2021-04-29 09:52:11

How to redirect from www to Bitrix virtual appliance version 7.4.4?

Good afternoon.
I'm trying to set up a redirect from www to the main domain, I have access to the server via SSH. As far as I understand, you need to find the nginx settings. Bitrix virtual appliance version 7.4.4 is installed on the server.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Denis Yuriev, 2021-04-29
@dyuriev

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

in the root of the site in .htaccess add

E
Eugene, 2021-04-29
@udjin123

I'll add a little to the answer above.
Redirects in BitrixEnv can be done at several levels:
1. At the nginx level (rarely used if further apache)
2. At the apache level (in htaccess)
3. At the PHP level (your own code or a ready-made module)
Here is just a little more about the latter, For people without special knowledge, this is the most ideal option. It is enough to install a ready-made free module from the Bitrix marketplace for managing redirects, and setting up all redirects will be reduced to a couple of clicks.

A
Alexey Dmitriev, 2021-04-29
@SignFinder

Yes, you are right, you need to redirect to nginx.
You can do this by googling "nginx redirect www to domain" and reading the search output.
There you just need to insert a 301 redirect into the nginx configuration file and re-read it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question