June 13, 2012 10:31AM
That's exactly what I thought, but when I used (.*) at the end and used the $1 I kept getting 404. When I made it the way it is now, it worked on my staging site as expected but not on my live site.

I can confirm that on neither site, the following does not work (404 error):

location /old {
rewrite ^/old/(.*)$ /new/$1 permanent;
}

the following will redirect anything from old to the landing page for the new section

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


here is the current config, with prior rewrites before this location block:

location / {
index index.php;
try_files $uri $uri/ @ee;
}

location @ee {
rewrite ^(.*) /index.php?/$1 last;
}

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

I tired to use (.*) and $2 in hopes that the prior $1 wasn't breaking it. Still no luck.
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: 245
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