首頁  >  文章  >  運維  >  apache如何開啟偽靜態

apache如何開啟偽靜態

步履不停
步履不停原創
2019-06-29 11:43:497028瀏覽

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

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn