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: (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/.*$ permanent;

This kind of works, but it redirects to the home page like this: (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
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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