Welcome! Log In Create A New Profile

Advanced

How to make nginx to redirect multiple subdomains?

Posted by precomx 
How to make nginx to redirect multiple subdomains?
April 03, 2014 06:45AM
How to make nginx to redirect multiple subdomains? Including non-www redirects to the domain with www.
For example, my website is abc.com, under the site has several directories aaa, bbb, ccc, ddd, DNS has been set up correctly, all point to the same IP. How to meet the following requirements:
Enter abc.com automatically redirected to www.abc.com
Enter aaa (or bbb, ccc, ddd) automatically redirected to the corresponding web directory, such as aaa. abc.com then displays the contents of the web root directory /aaa, while the address bar unchanged?
If you enter aaa.abc.com/aaa or www.abc.com/aaa returns 404 (as it has been redirected to the aaa directory, but no aaa aaa following directory, so returned 404)



Edited 1 time(s). Last edit at 04/03/2014 06:47AM by precomx.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 88
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready