Welcome! Log In Create A New Profile

Advanced

Do I need a redirect or rewrite for rewriting /sub-folder to a subdomain?

Posted by codecowboy 
Do I need a redirect or rewrite for rewriting /sub-folder to a subdomain?
February 20, 2015 05:42AM
If I want to transform links from http://exampledomain.com/sub-folder/some-article to http://subdomain.exampledomain.com/some-article where subdomain has the same name as the subfolder, do I need a rewrite or a redirect? I *think* I need a redirect but want to be sure I am doing it the recommended way.

I tried rewrite /sub-folder-name/(.*) $scheme://sub-folder-name.exampledomain.com/$1 permanent;

But this didn't seem to have any effect after restarting nginx.

Thanks!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 244
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