Welcome! Log In Create A New Profile

Advanced

Nginx permanent rewrite issues

Posted by jelson41 
Nginx permanent rewrite issues
February 21, 2012 12:46PM
We have some old URL's all over our website in the following format that we are trying to just redirect to the home page as they are giving page cannot be found errors:

http://www.oursite.com/go/base?id=XXX (XXX is a different set of letters in each URL and there are hundreds of them)

How would I go about redirecting something like this to the home page. I've tried this so far:

rewrite ^/go/.*$ http://www.oursite.com/ permanent;


This kind of works, but it redirects to the home page like this:

http://www.oursite.com/?id=XXX (we don't want it to show the ?id=XXX)

Any input is greatly appreciated.
Re: Nginx permanent rewrite issues
February 21, 2012 03:22PM
Figured this out for anybody that comes across this. I changed the rewrite line to this:

rewrite ^/go/.*$ /? permanent;

Now it redirects to www.oursite.com
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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