在php程序的目錄下有一個htaccess文件,這個文件起着對url重寫的做用,可是不巧的,在個人應用程序裏不起做用,baidu了一下,發現是php
AllowOverride All, 這個選項沒有打開,html
這個選項,只能寫在apache
<Directory />
</Directory>中,我在http.conf中打開了這個選項,結果網站出現了403禁止訪問的錯誤,經查看,結果發現是ide
<Directory />
Options Indexes
AllowOverride None
#AllowOverride All
Order allow,deny
Allow from all
</Directory>
不該在/這個目錄下,寫這個選項,應在應用程序的目錄下打開這個選項,網站
寫到www目錄下this
<Directory "http://www.cnblogs.com/WebRoot/Default">
這裏的相對目錄是對於配置文件中的ServerRoot而言.
#
# 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.0/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 All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
若是打開了這個選項,還不起做用,那麼就得檢查一下httpd.conf中打開了rewrite選項了沒有url
LoadModule rewrite_module modules/mod_rewrite.sospa