(暂未验证正确性)
discuz论坛重写参数
location / {
if (!-e $request_filename) {
rewrite ^/archiver/((fid|tid)-[\w\-]+\.html)$ /archiver/index.php?$1 last;
rewrite ^/forum-([0-9]+)-([0-9]+)\.html$ /forumdisplay.php?fid=$1&page=$2 last;
rewrite ^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /viewthread.php?tid=$1&extra=page%3D$3&page=$2 last;
rewrite ^/space-(username|uid)-(.+)\.html$ /space.php?$1=$2 last;
rewrite ^/tag-(.+)\.html$ /tag.php?name=$1 last;
break;
}
}
防盗链
location ~* ^.+\.(gif|jpg|png|swf|flv|rar|zip)$ {
valid_referers none blocked server_names *.onono.org http://localhost;
if ($invalid_referer) {
rewrite ^/ http://error.org/images/error.gif;
return 403;
}
}
WordPress
# SEO friendly URLs for WordPress
#
location / {
root /path/to/YOURDIRECTORY/public_html/forums;
index index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?q=$1 last;
}
}