Welcome! Log In Create A New Profile

Advanced

How to rewrite to escape the ? in the query string

Posted by njt1982 
How to rewrite to escape the ? in the query string
May 27, 2011 11:53AM
Hi all,

I've been using nginx for over a year to host my Drupal blog and several friends sites and love it.

I recently use wget to mirror a website I need to rebuild. This website has URLs in the form "script.ext?id=123"... wget has downloaded these as "script.ext?id=123.html". If I manually escape the ? as %3F, the nginx will serve the file, otherwise, it's trying to serve it as "script.ext" with the rest as $args...

I've tried using "rewrite" to escape it: eg,

rewrite ^/script.ext /script.ext%3F$args?

But I either get a 404 error or a 500 error (redirect loop)...

Does anyone have any suggestions?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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