rewrite problem

Bertrand Caplet bertrand.caplet at okira.net
Tue Sep 4 06:06:49 UTC 2012


sosogh <sosogh at 126.com> a écrit :

HI list

I want to redirect 
http://www.mysite.com/bbs/viewthread.php?tid=8123&extra=
to
http://www.mysite.com/forum.php?mod=viewthread&tid=8123

 

This is what I  place in the "server" block in the nginx.conf
rewrite  ^/bbs/viewthread.php?tid=([0-9]+).*$   /forum.php?mod=viewthread&tid=$1 last;

 

but when visit http://www.mysite.com/bbs/viewthread.php?tid=8123&extra=.
It shows 404 error.

 

Could anyone point me out what is wrong?
Thank you!




Take a look at your error log, it's write which file nginx can't find and you could see what's wrong with your regex.
Regards,
-- 
Envoyé de mon téléphone. Excusez la brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120904/535f2fe4/attachment.html>


More information about the nginx mailing list