LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 04-07-2010, 07:46 PM   #1
gavin2u
Member
 
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
Quote:
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
Quote:
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
Quote:
^/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.

V/R,

gavin
 
  


Reply

Tags
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 12:39 PM.

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