VPS侦探论坛

 找回密码
 注册
查看: 7631|回复: 1

关于伪静态和泛解析的问题,帮忙

[复制链接]
发表于 2011-10-13 08:13:04 | 显示全部楼层 |阅读模式

我的是centos5.6,装的是LNMP一键安装包,
目前服务器上有两个站点,一个需要做伪静态和泛解析
主要是我之前是APACHE,规则不知道怎么转换,另外需要用到跳转代码go.php,不知道如何设置
刚接触CENTOS,希望帮忙看看,谢谢
<VirtualHost *:80>
    ServerName  www.shzhutong.com
ServerAlias www.shzhutong.com
DocumentRoot /var/www/html/www6
    ErrorLog "logs/1xiu-error.log"
    CustomLog "logs/1xiu-access.log" common


<IfModule mod_rewrite.c>
     RewriteEngine On
  RewriteRule ^(.*)/(zsj|sqk|company)/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.*)/$ $1/$2/index.php?orderid=$3&a2=$4&a3=$5&a4=$6&a5=$7&a6=$8&a7=$9
#RewriteRule ^(.*)/archiver/((fid|tid)-[\w\-]+\.html)$ $1/archiver/index.php?$2
#  RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html$ $1/forumdisplay.php?fid=$2&page=$3
#  RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/viewthread.php?tid=$2&extra=page\%3D$4&page=$3
#  RewriteRule ^(.*)/space-(username|uid)-(.+)\.html$ $1/space.php?$2=$3
#  RewriteRule ^(.*)/tag-(.+)\.html$ $1/tag.php?name=$2
        RewriteRule ^(.*)/bbs/images/(.*)    $1/bbs/images/$2
  RewriteRule ^(.*)/bbs/(.*) http://bbs.shzhutong.com/$2
  RewriteRule ^(.*)/([a-z]+)/([a-z]+)([0-9]+)/$ $1/$2/$3.php?uid=$4
  RewriteRule ^(.*)/(sjs|yz|zs|sj)/([0-9]+)/?$ $1/$2/index.php?uid=$3
  RewriteRule ^(.*)/([a-z]+)/([0-9]+)/([0-9]*)([a-z]+)([0-9]?)-([0-9a-z]+)-([0-9]+).html$ $1/$2/$5.php?uid=$3&act=$7&gate=$4&exe=$6&page=$8
  RewriteRule ^(.*)/([a-z]+)/([0-9]+)/([a-z]+)-display-([a-z]+)([0-9]+).html$ $1/$2/$4.php?uid=$3&act=display&$5id=$6
  RewriteRule ^(.*)/([a-z]+)/([a-z_]+)-([0-9]+)(s([0-9]+))?(i([0-9]+))?p?([0-9]+)?$ $1/$2/$3.php?btype=$4&stype=$6&id=$8&page=$9
#  RewriteRule ^(.*)/(case)/(c)(([0-9]?)([0-9]?)([0-9]?)[0-9]*).html$ $1/cache/$3/$5/$6/$7/$4.htm
#RewriteRule ^(.*)/([a-z]+)/(a|m)(([0-9]?)([0-9]?)([0-9]?)[0-9]*).html$ $1/cache/$3/$5/$6/$7/$4.htm
  RewriteRule ^(.*)/([a-z]+)/([a-z_]+)([0-9]+)-?([0-9]+)?.html$ $1/$2/$3.php?id=$4&page=$5
  RewriteRule ^(.*)/([a-z]+)/([a-z_]+)([0-9]+)h.html$ $1/html/$2/$3$4h.html
  RewriteRule ^(.*)/([a-z]+)/([a-z_]+)-h([0-9]+)(s([0-9]+))?(i([0-9]+))?$ $1/html/$2/$3-h$4$5$7.html
  RewriteRule ^(.*)/zt([0-9]+)/$  $1/zt/topic.php?zid=$2
  RewriteRule ^(.*)/zt([0-9]+)/([a-z_]+)([0-9]+).html$ $1/zt/$3.php?zid=$2&type=$4
</IfModule>
           
</VirtualHost>
<VirtualHost *:80>
ServerName  *.shzhutong.com
ServerAlias *.shzhutong.com
DocumentRoot /var/www/html/www6
    ErrorLog "logs/f1xiu-error.log"
    CustomLog "logs/f1xiu-access.log" common
    <LocationMatch ^/go.php>
    Order allow,deny
    allow from all
</LocationMatch>
        DirectoryIndex go.php


   <IfModule mod_rewrite.c>
           RewriteEngine On
           #RewriteRule ^([url=http://)/?(www\.)?([a-zA-Z]+)\.shzhutng\.com/company/(.*)$]http://)?(www\.)?([a-zA-Z]+)\.shzhutng\.com/company/(.*)$[/url] http://www.shzhutong.com/company/index.php?city=$3
#RewriteRule ^(.*)$ /go.php
     RewriteRule ^(.*)/([a-z]+)/([a-z_]+)([0-9]+)-?([0-9]+)?.html$ $1/$2/$3.php?id=$4&page=$5
     RewriteRule ^(.*)/zb/$ $1/zb/index.php
     RewriteRule ^(.*)/(zsj|sqk|company)/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-(.*)/$ $1/$2/index.php?orderid=$3&a2=$4&a3=$5&a4=$6&a5=$7&a6=$8&a7=$9
     RewriteRule ^(.*)/sqk/$ $1/sqk/index.php
     RewriteRule ^(.*)/company/$ $1/company/index.php
#RewriteRule ^(.*)$ /go.php
  RewriteRule ^(.*)/([a-z]+)/([a-z]+)([0-9]+)/$ $1/$2/$3.php?uid=$4
  RewriteRule ^(.*)/(sjs|yz|zs|sj)/([0-9]+)/?$ $1/$2/index.php?uid=$3
  RewriteRule ^(.*)/([a-z]+)/([0-9]+)/([0-9]*)([a-z]+)([0-9]?)-([0-9a-z]+)-([0-9]+).html$ $1/$2/$5.php?uid=$3&act=$7&gate=$4&exe=$6&page=$8
  RewriteRule ^(.*)/([a-z]+)/([0-9]+)/([a-z]+)-display-([a-z]+)([0-9]+).html$ $1/$2/$4.php?uid=$3&act=display&$5id=$6
  RewriteRule ^(.*)/([a-z]+)/([a-z_]+)-([0-9]+)(s([0-9]+))?(i([0-9]+))?p?([0-9]+)?$ $1/$2/$3.php?btype=$4&stype=$6&id=$8&page=$9
   </IfModule>
</VirtualHost>
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2011-10-13 12:40:20 | 显示全部楼层


军哥出来帮忙看看啊
另外今天早晨论坛访问速度很慢,不知道是怎么回事
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-21 12:35 , Processed in 0.025953 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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