Welcome! Log In Create A New Profile

Advanced

rewrite url segment staging site and live site

June 12, 2012 10:47AM
I have a staging site that I test anything relating to the website before we deploy. I have an nginx config that I also test with for this staging site.

I wanted to rewrite a uri segment where a section of the site changed names.

example.com/old/page1
/old/page2

example.com/new/page1
/new/page2

I added the following rewrite, which works perfectly on the staging site.

location /old {
rewrite ^/old/? /new/$1 permanent;
}

when I added this to the live nginx config, the rewrite works, but only sort of:

what I want:
example.com/old/page1 --> example.com/new/page1

what I get:
example.com/old/page1 --> example.com/new

It's fine for now, but I don't know why the exact config would work different.

The live nginx config is different than the staging, but only in that it includes SSL info. This may be the problem, but I'm not sure why.

Thank you in advance for any suggestions and/or answers.
Subject Author Posted

rewrite url segment staging site and live site

caleboconnell June 12, 2012 10:47AM

Re: rewrite url segment staging site and live site

Francis Daly June 12, 2012 01:24PM

Re: rewrite url segment staging site and live site

caleboconnell June 13, 2012 10:31AM

Re: rewrite url segment staging site and live site

B.R. June 13, 2012 12:02PM

Re: rewrite url segment staging site and live site

Francis Daly June 14, 2012 05:18PM

Re: rewrite url segment staging site and live site

caleboconnell June 13, 2012 12:31PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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