Hi all,
I'm transferring my web server from Apache 2.2 to Nginx 0.7.61, but there is a problem with rewrite rules.
For example, there are two directories named /forum/ and /forum_real/ (existed), and the url which users requested will be something like "http://domain/forum/aaa/topics/topics.php.id.1". And it is rewrited by:
[code]
RewriteRule ^/forum/(\w+)/topics/topic.php.id.([0-9]+)$ /forum_real/forum_name/topics/topic.php?id=$2&name=$1 [L,NC]
[/code]
I've wrote the rule with Nginx and it works:
[code]
rewrite ^/forum/(\w+)/topics/topic.php.id.([0-9]+)$ /forum_real/forum_name/topics/topic.php?id=$2&name=$1 last;
[/code]
Also, there is another url like "http://domain/f/SOME_WORDS_IN_CHINESE/forum/aaa/topics/topics.php.id.1", the rewrite rule with Apache is:
[code]
RewriteRule ^(.*)/forum/(.*)/topics/topic_no.php(.*)$ /forum/$2/topics/topic_no.php$3
[/code]
So, the second url is rewrited twice. But the rule
[code]
rewrite ^/f/(.*)/forum/(.*)/topics/topic_no.php.(.*)$ /forum/$2/topics/topic_no.php.$3;
[/code]
doesn't work.
Could anyone help me? Thanks!
PS. Sorry for my poor English...