apache開啟偽靜態的步驟:
#開啟apache的設定檔httpd.conf,路徑:wamp\bin\apache\apache2. 4.9\conf\httpd.conf
找到
#LoadModule rewrite_module modules/mod_rewrite.so
把前面#去掉。沒有則添加,但必選獨佔一行,使apache支援mod_rewrite 模組
找到
<Directory "D:/ApacheServer/web"> # # 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>
把AllowOverride None 換成AllowOverride All 使apache支援.htaccess 檔案
重啟apache伺服器
在要啟用偽靜態的PHP 專案根目錄下建立.htaccess 檔案
更多Apache的相關技術文章,請造訪Apache教學欄位進行學習!
以上是apache如何開啟偽靜態的詳細內容。更多資訊請關注PHP中文網其他相關文章!