@wilmer.lemke
To redirect a directory in nginx server, you can use the "return" directive in the server block of your nginx configuration file. Here is an example of how you can redirect a directory:
1 2 3 |
location /old-directory { return 301 /new-directory; } |
In this example, any requests to "/old-directory" will be redirected to "/new-directory" with a 301 status code (permanent redirect).
1
|
sudo nginx -s reload |
Now, any requests to the old directory will be automatically redirected to the new directory.