Author Topic: Nginx Set up redirects  (Read 184 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Nginx Set up redirects
« on: April 02, 2025, 09:06:57 AM »
My web servers are Nginx & Apache, I want to set up redirects, I added 301 code in htaccess but doesn't work, I don't know how to set up 301 redirects for Nginx.

301 redirects
Target: (.*?) ?roy1/.*?html
To: $1

Offline
*****
Re: Nginx Set up redirects
« Reply #1 on: April 02, 2025, 10:57:36 AM »
.htaccess is for Apache; nginx will ignore them. Edit the virtual host conf file under the [server] directive block -- the basic construct is to use this syntax:
Code: [Select]
return 301 http://www.example.com$request_uri;