首页 » 默认不分类 » Linux开启伪静态启用.htaccess功能

Linux开启伪静态启用.htaccess功能

使Apache 支持Rewrite,只需要几步就搞定。
一、修改apache的配置文件 (这个文件一般在/etc/httpd/conf/httpd.conf)
找到这一句将前面的#号去掉,当然如果没有自己就添吧
LoadModule rewrite_module modules/mod_rewrite.so
现在去重启apache试试应该没问题了(重启命令service httpd restart)

二、要使用.htaccess要将AllowOverride None 改为 AllowOverride All (注意是单行的那条设置)
顺便说下 .htaccess文件(或者”分布式配置文件”)提供了针对每个目录改变配置的方法,即在一个特定的目录中放置一个包含指令的文件,其中的指令作用于此目录及其所有子目录。

三、打开自己网站根目录下的.htaccess 将规则写进去吧,如果没有此文件自己建一个,当然win主机不能建,随便传个文件上去用ftp工具改名字。

, , ,

转发到新浪微博 转发到新浪微博

目前这篇文章有3条评论(Rss)

  1. zinc | #1
    05/16/2012 at 13:25

    Another very entertaining post. Ive been reading through some of your posts and finally decided to drop a comment on this one. Please feel free to visit my site Doppler

  2. http://gpsmoto.org/ | #2
    05/16/2012 at 20:45

    Merely wanna remark that you have a very decent internet site , I love the style and design it really stands out.

  3. serivce | #3
    05/17/2012 at 05:31

    CDuJkC I value the blog article.Thanks Again. Keep writing.

我要评论