phpwind在nginx下设置伪静态的规则
废话不说,贴代码:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
server { listen 80; server_name phpwind.181000.com; index index.html index.htm index.php; root /opt/www/phpwind.181000.com; location / { rewrite ^(.*)-htm-(.*)$ $1.php?$2 last; rewrite ^(.*)u/([0-9]+)$ $1u.php?uid=$2 last; rewrite ^(.*)/simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2 last; rewrite ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/thread.php?fid=$1 last; rewrite ^(.*)/bbs.html$ $1/index.php?m=bbs last; rewrite ^(.*)/archiver/fid-([0-9]+).html$ $1/simple/?f$2.html last; rewrite ^(.*)/archiver/fid-([0-9]+)-page-([0-9]+).html$ $1/simple/?f$2_$3.html last; rewrite ^(.*)/archiver/tid-([0-9]+).html$ $1/simple/?t$2.html last; rewrite ^(.*)/archiver/tid-([0-9]+)-page-([0-9]+).html$ $1/simple/?t$2_$3.html last; rewrite ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/thread.php?fid=$2&page=$3 last; rewrite ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/read.php?tid=$2&page=$3 last; rewrite ^(.*)/space-(username|uid)-(.+)\.html$ $1/u.php?action=show&$2=$3 last; rewrite ^(.*)/tag-(.+)\.html$ $1/link.php?action=tag&tagname=$2 last; rewrite ^(.*)/([0-9]+)$ $1/thread.php?fid=$2&page=1 last; } location ~ .*\.(php|php5)?$ { fastcgi_pass 127.0.0.1:9000; include /opt/nginx/conf/fastcgi_params; } access_log /opt/nginx/logs/phpwind.181000.com.log access; } |