Nginx Pseudo-static rules
To rewrite the http://lovo.com/index.php?t=3 with pseudo-static rules into http://lovo.com/t3.html, you can add in the Nginx conf/nginx.conf.
Add in Location/{}, such as:
location/{
root /var/www/html;
index index.php index.html index.htm;
rewrite ^ (. *)/T (\d+) \.html$ $1/index.php?t=3 last;
}
Careful observation rewrite ^ (. *)/T (\d+) \.html$ $1/index.php?t=3 last; in fact, I feel nginx pseudo-static rules are very good to write. is to use a regular basis, a rewrite to declare, and then ^ is a pseudo-static rules, (. *) match any character, here is the domain name, T is the character you want to add here, such as you can add apple, orange, such as the name of the category, (\d+) matches the number, \. The HTML matches the suffix, and $ is the end of the regular match. The latter part is to rewrite the URL, with a start, representing the domain name,/index.php?t=3 is to rewrite the URL, with last;
Case:
Location /{
# # #以下为PHPCMS pseudo-staticrewriterules
rewrite ^ (. *) show-([0-9]+)-([0-9]+) \.html$ $1/show.php?itemid=$2&page=$3;
rewrite ^ (. *) list-([0-9]+)-([0-9]+) \.html$ $1/list.php?catid=$2&page=$3;
rewrite ^ (. *) show-([0-9]+) \.html$ $1/show.php?specialid=$2;
# # # #以下为PHPWind pseudo-static rewrite rules
rewrite ^ (. *)-htm-(. *) $ $1.php?$2 last;
rewrite ^ (. *)/simple/([a-z0-9\_]+\.html) $ $1/simple/index.php?$2 last;
}
This article from "TT's it big Miscellaneous, Welcome to join ~" blog, declined reprint!
Nginx Pseudo-static rules