首页 > 开发 > Apache > 正文

Apache 配置伪静态详细步骤

2020-04-16 19:24:50
字体:
来源:转载
供稿:网友
dz论坛目录下.htaccess文件内容:

程序代码
复制代码 代码如下:

# 将 RewriteEngine 模式打开
RewriteEngine On
# 修改以下语句中的 /bbs 为你的论坛目录地址,如果程序放在根目录中,请将 /bbs 修改为 /
RewriteBase /bbs
# Rewrite 系统规则请勿修改
RewriteRule ^archiver/((fid|tid)-[/w/-]+/.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 ^space-(username|uid)-(.+)/.html$ space.php?$1=$2
RewriteRule ^tag-(.+)/.html$ tag.php?name=$1

配置Apache;
1、修改Apache 的配置文件 httpd.conf 。将#LoadModule rewrite_module modules/mod_rewrite前面的#去掉

2、在 httpd.conf中添加:
复制代码 代码如下:

<IfModule mod_rewrite.c>
RewriteEngine On
#...
</IfModule>

3、保存httpd.conf并重启Apache

您可能感兴趣的文章:

Apache服务器中使用.htaccess实现伪静态URL的方法Apache中使非伪静态url跳转到伪静态url的方法PHP+APACHE实现网址伪静态PHP伪静态Rewrite设置之APACHE篇php伪静态之APACHE篇Apache伪静态Rewrite详解thinkphp路由规则使用示例详解和伪静态功能实现(apache重写)apache伪静态与iis伪静态规则与配置区别介绍apache中伪静态配置和使用(Apache虚拟主机下Discuz伪静态)WampServer设置apache伪静态出现404 not found及You don''t have permission to access / on this server解决方法分析
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表