linux apache 安装 rewrite,Linux主机下Apache如何使用rewrite模块
Linux主機下Apache使用rewrite模塊解決方案:
1. 需要在apache的配置文件httpd.conf中加入相應配置:
Apache-1.3.x版本,在/usr/prima/apache_ssl/conf/httpd.conf里加入:
LoadModule rewrite_module libexec/mod_rewrite.so
AddModule mod_rewrite.c
Apache-2.x版本,在/etc/httpd/conf/httpd.conf里加入:
LoadModule rewrite_module modules/mod_rewrite.so
2. 重啟apache:
Apache-1.3.x:
/usr/prima/apache_ssl/bin/apachectl restart
Apache-2.x:
/etc/init.d/httpd restart
3. 在/usr/prima/etc/httpd/virtual.conf的需要.htaccess和rewrite功能的站點配置中加入:
AllowOverride Options FileInfo
注意FileInfo,這是支持RewriteEngine的關鍵
4. 之后只需要用戶自行在需要.htaccess的目錄中配置.htaccess文件了,如需要用rewrite模塊,加入如下:
RewriteEngine On
[rewrite配置]
5. Windows下可以先將.htaccess內容寫入一個文本文件中,然后將此文本文件上傳到服務器需要.htaccess的目錄中,改名為.htaccess即可。
按照以上配置,即可使用rewrite模塊。
總結
以上是生活随笔為你收集整理的linux apache 安装 rewrite,Linux主机下Apache如何使用rewrite模块的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: red hat linux5 u盘安装,
- 下一篇: linux centos 6.5压缩文件