您的位置:首页 > 运维架构 > Apache

Freebsd6.2 使用 apache2 + rewrite

2008-07-01 17:12 585 查看
1.ports安装apache2

2.安装后查看/usr/local/etc/apache22/httpd.conf中是否有
LoadModule rewrite_module libexec/apache22/mod_rewrite.so
没有就重装apache2,安装时候选mod_rewrite

3.编辑 /usr/local/etc/apache22/Includes/httpd-vhost.conf
ee /usr/local/etc/apache22/Includes/httpd-vhost.conf

4.在相应的虚拟目录中加入

<IfModule rewrite_module> # 这里要注意的是不同.c格式
RewriteEngine On
#RewriteLog "/var/log/rewrite_log"
#RewriteLogLevel 10 报错等级 > 9 就是所有
RewriteRule ^(.*)/html_(.*)/.html$ $1/html/buy.php?pid=$2
</IfModule>

5.apachectl stop

6.apachectl start
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: