Welcome! Log In Create A New Profile

Advanced

Rewrite Rule convert

December 03, 2010 01:54AM
I am a newer for the nginx
I am tired to convert the rule form apache to nginx but it doesn't work.
Anyone can help and point out my error?
Thanks

The Source Apache Rule:
RewriteRule ^\/?index\.html$ /html/index.html [L]
RewriteRule ^((ajax/|accounts/|software/download|shortcut|flashcookie)/?.*)$ /index.php/$1 [L]
RewriteRule ^\/?((cn|en|tw)?\/?([a-zA-Z][a-zA-Z0-9_\-]+)*\.html)$ /html/$1 [L]
RewriteRule ^\/?((cn|en|tw)?\/?news\/\d+)\.html$ /html/$1.html [L]

My Convert Rules for Nginx:
rewrite ^/?index\.html$ /html/index.html last;\
rewrite ^((ajax/|accounts/|software/download|shortcut|flashcookie)/?.*)$ /index.php/$1 last;
rewrite ^/\/?((cn|en|tw)?\/?([a-zA-Z][a-zA-Z0-9_\-]+)*\.html)$ /html/$1 last;
rewrite ^\/?((cn|en|tw)?\/?news\/\d+)\.html$ /html/$1.html last;

Now I link to my ajax/|accounts/|software/download|shortcut|flashcookie page, it show error 404
Subject Author Posted

Rewrite Rule convert

u-name December 03, 2010 01:54AM

Re: Rewrite Rule convert

Igor Sysoev December 03, 2010 02:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 105
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready