secker 发表于 2012-6-1 09:05:15

jtbc cms的ngnix伪静态规则

如题,求大牛指点

secker 发表于 2012-6-1 09:08:29

下面是apache下针对jtbc的规则
#伪静态
RewriteEngine on
RewriteRule ^aboutus/detail-(.*).html$ aboutus/index.php?type=detail&id=$1
RewriteRule ^aboutus/detail-(.*)-(.*).html$ aboutus/index.php?type=detail&id=$1&page=$2
RewriteRule ^article/list-(.*)-0.html$ article/index.php?type=list&classid=$1
RewriteRule ^article/detail-(.*).html$ article/index.php?type=detail&id=$1
RewriteRule ^article/detail-(.*)-(.*).html$ article/index.php?type=detail&id=$1&page=$2
RewriteRule ^download/list-(.*)-0.html$ download/index.php?type=list&classid=$1
RewriteRule ^download/detail-(.*).html$ download/index.php?type=detail&id=$1
RewriteRule ^download/detail-(.*)-(.*).html$ download/index.php?type=detail&id=$1&page=$2

#防盗链
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://localhost/.*$
RewriteCond %{HTTP_REFERER} !^http://localhost$
RewriteCond %{HTTP_REFERER} !^http://localhost/.*$
RewriteCond %{HTTP_REFERER} !^http://localhost$
RewriteRule .*.(png|gif|jpg|swf|flv)$ http://localhost/logo.gif

secker 发表于 2012-6-1 09:10:07

另:
rewrite规则写在nginx.conf里面是否比写在.htaccess文件里面效率高?
页: [1]
查看完整版本: jtbc cms的ngnix伪静态规则