Hi, all
Last night, I had changed my webserver form lighty to nginx, the following code is the rewrite rules in lighttpd.conf:
[code]
url.rewrite = (
"/index\.asp" => "/index.php",
"/index\.asp\?boardid=([0-9]+)$" => "/forum-$1-1.html",
"/index\.asp\?boardid=([0-9]+)(.*)$" => "/forum-$1-1.html",
"/index_([0-9]+)(.*)$" => "/forum-$1-1.html",
"/dispbbs\.asp\?boardID=([0-9]+)&ID=([0-9]+)(.*)$" => "/thread-$2-1-1.html",
"^(.*)/dispbbs_([0-9]+)_([0-9]+)_([0-9]+)_skin([0-9]+)_([0-9]+)_([0-9]+)\.html$" => "$1/thread-$4-1-1.html",
"^(.*)/dispbbs_([0-9]+)_([0-9]+)_([0-9]+)_skin([0-9]+)_([0-9]+)\.html$" => "$1/thread-$4-1-1.html",
"^(.*)/dispbbs_([0-9]+)_([0-9]+)_([0-9]+)_skin([0-9]+)\.html$" => "$1/thread-$4-1-1.html",
"^(.*)/dispbbs_([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)\.html$" => "$1/thread-$3-1-1.html",
"^(.*)/dispbbs_([0-9]+)_([0-9]+)_([0-9]+)_(\w+)\.html$" => "$1/thread-$3-1-1.html",
"^(.*)/dispbbs_([0-9]+)_([0-9]+)_([0-9]+)\.html$" => "$1/thread-$3-1-1.html",
"^(.*)/dispbbs_([0-9]+)_([0-9]+)(.+)*\.html$" => "$1/thread-$3-1-1.html",
"^(.*)/dispbbs_([0-9]+)_([0-9]+)\.html$" => "$1/thread-$3-1-1.html",
"/dv_rss_(.+)_([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)_count([0-9]+)\.html" => "/archiver/tid-$2.html",
"/dv_rss_(.+)_([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)\.html" => "/archiver/tid-$2.html",
"/dv_rss_(.+)_([0-9]+)_([0-9]+)_([0-9]+)\.html" => "/archiver/tid-$2.html",
"/dv_rss_(.+)_([0-9]+)_([0-9]+)_count([0-9]+)\.html" => "/forum-$2-1.html",
"/dv_rss_(.+)_([0-9]+)_([0-9]+)\.html" => "/forum-$2-1.html",
"/dv_rss_(.+)_([0-9]+)\.html" => "/forum-$2-1.html",
"/dv_rss(.+)*\.html" => "/archiver/",
"/UploadFile/(.*)" => "/index.php",
"/dispbbs\.asp\?(.*)&id=([0-9]+)(.*)" => "/thread-$2-1-1.html",
"/dispuser\.asp\?id=([0-9]+)(.*)" => "/space-uid-$1.html",
"/dv_rss\.asp\?(.*)&id=([0-9]+)(.*)" => "/archiver/tid-$2.html",
"/dv_rss\.asp\?(.*)boardid=([0-9]+)(.*)" => "/archiver/fid-$2.html",
"/dv_rss\.asp\?s=xml" => "/rss.php",
"/dv_rss\.asp(.*)" => "/archiver/"
)
[/code]
In nginx, I put the following rules in the nginx.conf,
[code]
rewrite "/index\.asp" "/index.php" last;
rewrite "/index\.asp\?boardid=([0-9]+)$" "/forum-$1-1.html" last;
rewrite "/index\.asp\?boardid=([0-9]+)(.*)$" "/forum-$1-1.html" last;
rewrite "/index_([0-9]+)(.*)$" "/forum-$1-1.html" last;
rewrite "^/dispbbs\.asp\?boardID=([0-9]+)&ID=([0-9]+).*$" "/thread-$2-1-1.html" last;
rewrite "/dispbbs_([0-9]+)_([0-9]+)_([0-9]+)_skin([0-9]+)_([0-9]+)_([0-9]+)\.html$" "$1/thread-$3-1-1.html" last;
rewrite "/dispbbs_([0-9]+)_([0-9]+)_([0-9]+)_skin([0-9]+)_([0-9]+)\.html$" "$1/thread-$3-1-1.html" last;
rewrite "/dispbbs_([0-9]+)_([0-9]+)_([0-9]+)_skin([0-9]+)\.html$" "$1/thread-$3-1-1.html" last;
rewrite "/dispbbs_([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)\.html$" "$1/thread-$2-1-1.html" last;
rewrite "/dispbbs_([0-9]+)_([0-9]+)_([0-9]+)_(\w+)\.html$" "$1/thread-$2-1-1.html" last;
rewrite "/dispbbs_([0-9]+)_([0-9]+)_([0-9]+)\.html$" "$1/thread-$2-1-1.html" last;
rewrite "/dispbbs_([0-9]+)_([0-9]+)(.+)*\.html$" "$1/thread-$2-1-1.html" last;
rewrite "/dispbbs_([0-9]+)_([0-9]+)\.html$" "$1/thread-$2-1-1.html" last;
rewrite "/dv_rss_(.+)_([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)_count([0-9]+)\.html" "/archiver/tid-$2.html" last;
rewrite "/dv_rss_(.+)_([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)\.html" "/archiver/tid-$2.html" last;
rewrite "/dv_rss_(.+)_([0-9]+)_([0-9]+)_([0-9]+)\.html" "/archiver/tid-$2.html" last;
rewrite "/dv_rss_(.+)_([0-9]+)_([0-9]+)_count([0-9]+)\.html" "/forum-$2-1.html" last;
rewrite "/dv_rss_(.+)_([0-9]+)_([0-9]+)\.html" "/forum-$2-1.html" last;
rewrite "/dv_rss_(.+)_([0-9]+)\.html" "/forum-$2-1.html" last;
rewrite "/dv_rss(.+)*\.html" "/archiver/" last;
rewrite "/UploadFile/(.*)" "/index.php" last;
rewrite "/dispbbs\.asp\?(.*)&id=([0-9]+)(.*)" "/thread-$2-1-1.html" last;
rewrite "/dispuser\.asp\?id=([0-9]+)(.*)" "/space-uid-$1.html" last;
rewrite "/dv_rss\.asp\?(.*)&id=([0-9]+)(.*)" "/archiver/tid-$2.html" last;
rewrite "/dv_rss\.asp\?(.*)boardid=([0-9]+)(.*)" "/archiver/fid-$2.html" last;
rewrite "/dv_rss\.asp\?s=xml" "/rss.php" last;
rewrite "/dv_rss\.asp(.*)" "/archiver/" last;
[/code]
unfortunately, it is not working.
Is there any problem?
thanks,
gaivn