Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 2nd July 2013, 15:52
jaypabs jaypabs is offline
Join Date: Jun 2013
Posts: 69
Thanks: 0
Thanked 1 Time in 1 Post
Default Non-www to www and vice versa

How can I rewrite nginx to redirect non-www to www and vice versa?

I have tried the following by adding it in the nginx directives without luck.

non-www to www:
	server {
		server_name example.com;
		rewrite ^(.*) http://www.example.com$1 permanent;
www to non-www:
	server {
		server_name www.example.com;
		rewrite ^(.*) http://example.com$1 permanent;
Reply With Quote
Sponsored Links


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 17:27.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.