apache httpd mod_rewrite

 


安装:


1.如果为初次安装apache,在编译时增加--enable-rewrite选项。 

./configure --prefix=/usr/local/apachel --enable-so --enable-mods-shared=all --enable-rewrite --enable-cache 


2.如果已安装apahe httpd,但通过./apachectl -l发现未安装mod_rewrite,增加mod_rewrite模块方法:


# 在apache的源码安装目录中寻找mod_rewrite.c文件 

find . -name mod_rewrite.c


# 进入包含mod_rewrite.c文件的目录 

cd PATH/to/mod_rewrite.c


# 完成后apache的modules目录中会有mod_rewrite.so文件。 

/usr/local/apache/bin/apxs -c mod_rewrite.c 

/usr/local/apache/bin/apxs -i -a -n mod_rewrite mod_rewrite.la 

 

 

# 编辑httpd.conf文件,加入: 

LoadModule rewrite_module modules/mod_rewrite.so 


 

 

你可能感兴趣的:(rewrite)