VPS侦探论坛

 找回密码
 注册
查看: 4692|回复: 2

jtbc cms的ngnix伪静态规则

[复制链接]
发表于 2012-6-1 09:05:15 | 显示全部楼层 |阅读模式

如题,求大牛指点
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2012-6-1 09:08:29 | 显示全部楼层


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

#防盗链
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://localhost/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://localhost$ [NC]
RewriteCond %{HTTP_REFERER} !^http://localhost/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://localhost$ [NC]
RewriteRule .*.(png|gif|jpg|swf|flv)$ http://localhost/logo.gif [R,NC]
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2012-6-1 09:10:07 | 显示全部楼层

另:
rewrite规则写在nginx.conf里面是否比写在.htaccess文件里面效率高?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-23 03:32 , Processed in 0.026246 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表