N
N
Nick Bukovskiy2017-03-20 17:30:05
Nginx
Nick Bukovskiy, 2017-03-20 17:30:05

How to configure nginx server to redirect to a single entry point to a site?

How to configure nginx server to redirect all requests to one file?
When setting up apache, this was done in the .htaccess file in the public folder with the project.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
Urvin, 2017-03-20
@sonterix

Redirects in NGINX are set in the configuration file. Often, one configuration file is allocated for one domain and this thing is lying around in /etc/nginx/sites-available/*.
In your case, the redirect snippet in such a config file could be:

server
{
  ...
  location / {
    try_files $uri $uri/ /index.php?_url=$uri&$args;
  }
  ...
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question