码迷,mamicode.com
首页 > Web开发 > 详细

apache伪静态设置

时间:2017-03-25 16:27:43      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:discuz   新建   topic   index.php   use   forum   page   article   display   

在网站根目录下新建一个.htaccess文件即可,编辑如下

RewriteEngine On
RewriteRule ^index.html$ index.php
RewriteRule ^game.html$ game.php
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 ^user.html$ user.php
RewriteRule ^pay.html$ pay.php
RewriteRule ^card.html$ card.php
RewriteRule ^reg.html$ reg.php
RewriteRule ^about.html$ about.php
RewriteRule ^login.html$ login.php

#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

apache伪静态设置

标签:discuz   新建   topic   index.php   use   forum   page   article   display   

原文地址:http://www.cnblogs.com/as3lib/p/6617410.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!