首頁 > 運維 > Apache > 主體

apache如何開啟偽靜態

步履不停
發布: 2019-07-26 09:55:52
原創
7091 人瀏覽過

apache如何開啟偽靜態

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&#39;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中文網其他相關文章!

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!