程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 網頁編程 >> PHP編程 >> 關於PHP編程 >> apache配置,apache

apache配置,apache

編輯:關於PHP編程

apache配置,apache


<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerAdmin [email protected]
    DocumentRoot "e:/www/WapSources/01 code"
    ServerName wap.weilan.com
    #ServerAlias www.dummy-host.example.com
    #ErrorLog "logs/dummy-host.example.com-error.log"
    #CustomLog "logs/dummy-host.example.com-access.log" common
    
    <Directory "e:/www/WapSources/01 code">
        Options Indexes FollowSymLinks
        AllowOverride all
        Order allow,deny
        Allow from all
    </Directory>
    <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
        RewriteRule .* - [F]
        Rewriterule ^(.*)/(.*)/index.html$ $1/index.php?$2
        Rewriterule ^(.*)/(.*)/index(\d+).html$ $1/index.php?$2&page=$3
        Rewriterule ^(.*)/(.*)/a(\d+)\.html$ $1/index.php?$2/$3
        Rewriterule ^(.*)/u/(\d+)/(.*)$ $1/index.php?u&$2&$3
        Rewriterule ^(.*)/u/(\d+)/(.*)/$ $1/index.php?u&$2&$3
        Rewriterule ^(.*)/u/(\d+)$ $1/index.php?u&$2
        Rewriterule ^(.*)/u/(\d+)/$ $1/index.php?u&$2
        Rewriterule ^(.*)/(.*)/index.html\?(.*) $1/index.php?$2&$3
        Rewriterule ^(.*)/(.*)/index(\d+).html\?(.*) $1/index.php?$2&$3
        Rewriterule ^(.*)/index.action(.*) $1/index.php$3
    </IfModule>
    
</VirtualHost>

簡潔版:

#指定自己的哪個網卡的哪個IP地址,可以訪問虛擬主機
NameVirtualHost *:80
<VirtualHost *:80>
 #指定虛擬主機的域名
 ServerName yangzailu.com
 #指定虛擬目錄
 DocumentRoot "e:/www/web1"
 #指定目錄權限
 <Directory "e:/www/web1">
       Options Indexes FollowSymLinks
       AllowOverride All
       Order Deny,Allow
       Deny from all
       Allow from all
 </Directory>
</VirtualHost>

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved