I
I
imwp2019-01-22 21:11:48
Nginx
imwp, 2019-01-22 21:11:48

Analogue of a redirect for NGINX?

Hello, we have moved from Apache to Nginx. Previously, we had such a redirect. Those. if only the main page of the site (root) was requested, then there was a default redirect to /en/

RewriteEngine On
RewriteBase /en/

RewriteCond %{REQUEST_URI} ^/$
RewriteRule .* https://domain/en/$1 [L]

Now the redirect has stopped working in .htaccess, how can it be described for NGINX?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynn "Coffee Man", 2019-01-22
@imwp

location = / {
    rewrite ^ /en/;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question