Control Web Panel

WebPanel => Apache => Nginx => Topic started by: gailclark80 on April 02, 2025, 09:06:57 AM

Title: Nginx Set up redirects
Post by: gailclark80 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
Title: Re: Nginx Set up redirects
Post by: overseer 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;