先前配置5IBT的时候,知道什么是url-rewrite,但就是配置不好,按照介绍也没有弄成功,总是显示出错。恰巧今天在弄wordpress建设linux学习笔记网站的时候突然灵感一现,找到了解决的方法。感觉不错。终于能看见xxx.html的伪html静态网页了。
下面是方法:
首先重新编辑apache,加入mod-rewrite模块。就是在./configure中加入–enable-rewrite 参数。
编辑完成以后,配置得当,书写rewrite规则即可!
设置apache配置文件,可以让APACHE支持.htaccess(很重要!)
改为JavaScript代码
- vi httpd.conf
- 文件,找到
- <Directory />
- Options FollowSymLinks
- AllowOverride None
- </Directory>
- </Directory>
XML/HTML代码
- <Directory />
- Options FollowSymLinks
- AllowOverride All
- </Directory>
- </Directory>
就可以了
man对AllowOverride 的解释:
AllowOverride controls what directives may be placed in .htaccess files.
It can be "All", "None", or any combination of the keywords:
Options FileInfo AuthConfig Limit就是说,将None改为All,.htaccess文件才能被支持!
然后如法在5ibt上面炮制,成功!
This entry was posted
on 星期二, 01月 22nd, 2008 at 9:25 pm and is filed under Linux服务器篇.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
我要评论