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

apache url_rewrite module 安装/配置

2007-03-19 21:56 381 查看
url rewrite是Apache中一个很有用的功能,因为手上的项目要用到该功能,所以今天安装测试了一下.

1. 在http.conf文件中,找到LoadModule rewrite_module modules/mod_rewrite.so,把前面的注释(#)去掉.

2. 在<Directory/>中,设置 AllowOverride All

3. 在网页文件夹中新建一个.htaccess文件,里面进行url rewrite配置: (Windows平台不能创建.htaccess这样以.开头的文件,我是用Eclipse创建的)
DirectoryIndex index.htm index.php

RewriteEngine on
# company index a-z pattern
RewriteRule ^aaa.html$ /aaa.php

这样当你在浏览器中输入aaa.html的时候实际是访问aaa.php.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: