其實常見問題里已經(jīng)說明了如下:
9 是否支持rewrite?
可以肯定地回答,支持.有些同學(xué)在apache的安裝目錄下找不到mod_rewrite.so文件,總在問,為什么沒有這個文件或是不是不支持之類等等?
原因很簡單的,不同的編譯方式就有不同的結(jié)果.如果是不是動態(tài)方式編譯或添加的,是找不到這個文件的.也就是說,在靜態(tài)編譯是沒有這個文件的,而是直接編譯進(jìn)apache里了.
可以通過phpinfo信息里查看 apache2handler 的 Loaded Modules 部分,能看到有 mod_rewrite 模塊,即表示已支持.
但是有部分系統(tǒng)還是不能正常使用,原因可能是這樣,打開httpd.conf,找到
<Directory "/www/wdlinux/httpd-2.2.16/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# 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
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
將 <Directory "/www/wdlinux/httpd-2.2.16/htdocs">
該為<Directory "/www/web/wdlinux">
將 AllowOverride None
該為 AllowOverride all
可以開多一個目錄控制,加上 AllowOverride
可以開多一個目錄控制,加上
AllowOverride all
就可以