设为首页 收藏本站
查看: 901|回复: 0

[经验分享] apache伪静态设置

[复制链接]
发表于 2017-12-25 14:38:32 | 显示全部楼层 |阅读模式
RewriteEngine On  

#游戏列表详细介绍  
RewriteRule ^g-([0-9]+).html$ game.php?action=gamelist_desc&game_id=$1
  
#游戏开服表
  
RewriteRule ^serverlist-([0-9]+).html$ website.php?action=server_list&game_id=$1
  
#游戏官网伪静态
  
RewriteRule ^w-([A-Za-z0-9_]+).html$ website.php?website=$1
  
RewriteRule ^w-([A-Za-z0-9_]+)-news.html$ website.php?action=news&website=$1
  
RewriteRule ^w-([A-Za-z0-9_]+)-xinwen.html$ website.php?action=news&website=$1&category_id=7
  
RewriteRule ^w-([A-Za-z0-9_]+)-huodong.html$ website.php?action=news&website=$1&category_id=8
  
RewriteRule ^w-([A-Za-z0-9_]+)-meiti.html$ website.php?action=news&website=$1&category_id=9
  
RewriteRule ^w-([A-Za-z0-9_]+)-gonglue.html$ website.php?action=news&website=$1&category_id=10
  
RewriteRule ^w-([A-Za-z0-9_]+)-news-page-([0-9]+).html$ website.php?action=news&website=$1&page=$2
  
RewriteRule ^w-([A-Za-z0-9_]+)-news-([0-9]+).html$ website.php?action=art&website=$1&content_id=$2
  
RewriteRule ^w-([A-Za-z0-9_]+)-ziliao.html$ website.php?action=ziliao&website=$1
  
RewriteRule ^w-([A-Za-z0-9_]+)-ziliao-page-([0-9]+).html$ website.php?action=ziliao&website=$1&page=$2
  
RewriteRule ^w-([A-Za-z0-9_]+)-ziliao-([0-9]+).html$ website.php?action=art&website=$1&content_id=$2
  
#新闻伪静态
  
RewriteRule ^news-([0-9]+).html$ news.php?id=$1
  
RewriteRule ^news-([0-9]+)-p([0-9]+).html$ news.php?id=$1&page=$2
  
RewriteRule ^content-([0-9]+).html$ content.php?id=$1
  
RewriteRule ^content-([0-9]+)-([0-9]+).html$ content.php?id=$1&page=$2
  
RewriteRule ^c/([A-Za-z0-9_]+).html$ game.php?action=guildstart&myworld=$1
  
RewriteRule ^index.html$ index.php
  
RewriteRule ^game.html$ game.php
  
RewriteRule ^kaif.html$ kaif.php
  
RewriteRule ^user.html$ user.php
  
RewriteRule ^pay.html$ pay.php
  
RewriteRule ^card.html$ card.php
  
RewriteRule ^reg.html$ reg.php
  
RewriteRule ^about.html$ about.php?a=1
  
RewriteRule ^login.html$ login.php
  

  
#404页面
  
RewriteCond %{REQUEST_FILENAME} !-f
  
RewriteCond %{REQUEST_FILENAME} !-d
  
RewriteRule .? /404.php [L]
  
#不允许直接访问 下面目录下的php文件
  
RewriteCond % !^$
  
RewriteRule api/(.*).(php)$ – [F]
  
RewriteRule config/(.*).(php)$ – [F]
  
RewriteRule ebak/(.*).(php)$ – [F]
  
RewriteRule hi_ports/(.*).(php)$ – [F]
  
RewriteRule includes/(.*).(php)$ – [F]
  
RewriteRule pay/(.*).(php)$ – [F]
  
RewriteRule templates/(.*).(php)$ –[F]
  
RewriteRule uploads/(.*).(php)$ – [F]
  
#不允许访问 .inc .txt .sql .conf扩展名的文件
  
<Files ~ "\.(inc|txt|sql|conf)$">
  
Order allow,deny
  
Deny from all
  
</Files>
  

  
#discuz 3.3伪静态规则
  
RewriteCond %{QUERY_STRING} ^(.*)$
  
RewriteRule ^(.*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2&%1
  
RewriteCond %{QUERY_STRING} ^(.*)$
  
RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3&%1
  
RewriteCond %{QUERY_STRING} ^(.*)$
  
RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3&%1
  
RewriteCond %{QUERY_STRING} ^(.*)$
  
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&%1
  
RewriteCond %{QUERY_STRING} ^(.*)$
  
RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3&%1
  
RewriteCond %{QUERY_STRING} ^(.*)$
  
RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3&%1
  
RewriteCond %{QUERY_STRING} ^(.*)$
  
RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3&%1
  
RewriteCond %{QUERY_STRING} ^(.*)$
  
RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.html$ $1/archiver/index.php?action=$2&value=$3&%1
  
RewriteCond %{QUERY_STRING} ^(.*)$
  
RewriteRule ^(.*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ $1/plugin.php?id=$2:$3&%1

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-427879-1-1.html 上篇帖子: 关于log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2. 下篇帖子: logstash实战filter插件之grok(收集apache日志)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

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