文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>利用apache的 RewriteRule功能实现URL跳转

利用apache的 RewriteRule功能实现URL跳转

时间:2007-07-18  来源:玩皮鼠

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /usr/local/apache/htdocs/bbs
    ServerName bbs.gamebean.com
    ErrorLog logs/bbs.gamebean_error_log
    CustomLog logs/bbs.gamebean-access_log common    
 <Directory "/usr/local/apache/htdocs/bbs">
       
        # . RewriteEngine ....
        RewriteEngine On

        # ........ /discuz ....................... /discuz ... /
        RewriteBase /

        # Rewrite ........
        RewriteRule ^archiver/([a-z0-9\-]+\.html)$ archiver/index.php?$1
        RewriteRule ^forum-([0-9]+)-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2
        RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ viewthread.php?tid=$1&extra=page\%3D$3&page=$2
        RewriteRule ^profile-(username|uid)-(.+)\.html$ viewpro.php?$1=$2
        RewriteRule ^space-(username|uid)-(.+)\.html$ space.php?$1=$2
        SetOutputFilter DEFLATE
        AddOutputFilterByType DEFLATE text/html text/plain text/xml
        AddOutputFilter DEFLATE htm html php xml js 
     </Directory>
</VirtualHost>

更多注释我就不写了,要用正则的时候,去google一下  
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载