Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 04-07-2010, 07:46 PM   #1
Registered: Nov 2007
Location: Beijing, China
Distribution: Any free distro.
Posts: 47

Rep: Reputation: 15
Question nginx 0.7.65 rewrite url with querystring problem?

Hi, all

Recently, I altered my web server lighty to nginx. And now, Struggling with some problems.

First, I have a site in nginx which only rewrites urls and redircts them to a new domain, and this site has exactly no file in its root directory.
I put some rewrite rules (just string rules, no querystring) in my nginx.conf

list 1
rewrite ^/index_([0-9]+)(.*)$ /forum-$1-1.html last;
rewrite ^/dispbbs_([0-9]+)_([0-9]+)\.html$ /thread-$2-1-1.html last;
Those rules work perfect till now.

However, some rules that used to rewrite url with querystring do not work as hoped.

list 2
location /index.asp {
if ($arg_boardid ~ "^([0-9]+)") {
rewrite ^ /forum-$arg_boardid-1.html break;
rewrite ^ /index.php break;
location /dispbbs.asp {
rewrite ^ /thread-$arg_id-1-1.html break;

And, these rules are converted from rules under httpd server,

list 3
^/dispbbs\.asp\?boardID=([0-9]+)&ID=([0-9]+).*$ /thread-$2-1-1.html;
^/dispbbs\.asp\?(.*)&id=([0-9]+)(.*)$ /thread-$2-1-1.html;
^/index\.asp\?boardid=([0-9]+)(.*)$ /forum-$1-1.html;
^/index\.asp\?boardid=([0-9]+)$ /forum-$1-1.html;
^/index\.asp$ /index.php;

So, what's the matter with rules listed in the list 2? and how could I make it woking.




nginx, rewrite

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
rewrite rule for url change ravibhure Linux - Server 2 01-21-2010 09:12 PM
URL rewrite rule not working... vikram_cvk Linux - Software 1 12-03-2008 02:14 AM
URL rewrite help needed rino.caldelli Linux - Server 4 09-28-2007 04:19 PM
apache url rewrite gallew Linux - Server 0 08-25-2006 03:54 AM
Mod rewrite problem .. want a friendly/readable url vikram_cvk Linux - Server 1 08-23-2006 06:18 PM

All times are GMT -5. The time now is 10:41 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration