rewrite assistance

daveyfx nginx-forum at nginx.us
Wed Nov 24 00:41:04 MSK 2010


Hi all,

I'm trying to add in a rewrite rule that will take this string and just
do a redirect to /
/preview.php?controllerName=channel&id=2

Since the query string can vary, how would I craft my rewrite
appropriately to do this?  I've tried a few variations of the following,
but all it does is remove the "preview.php" portion of the string,
leaving the "?controllerName=channel&id=2"
rewrite ^/preview.php(.*) / permanent;

Essentially I just watch to match against "preview.php" and redirect to
the index portion of the site.

Thanks!

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,152792,152792#msg-152792




More information about the nginx mailing list