Login
Register
Home
Wiki Knowledge Base
FreeDNS
Facebook
Linux Support
Control Web Panel
MENU
Home
Help
Search
Login
Register
Control Web Panel
»
WebPanel
»
Apache
»
Nginx
»
Nginx Set up redirects
« previous
next »
Print
Pages: [
1
]
Author
Topic: Nginx Set up redirects (Read 178 times)
0 Members and 1 Guest are viewing this topic.
gailclark80
Newbie
Posts: 45
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
Logged
overseer
Hero Member
Posts: 1345
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;
Logged
Print
Pages: [
1
]
« previous
next »
Control Web Panel
»
WebPanel
»
Apache
»
Nginx
»
Nginx Set up redirects