Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> 關於Android編程 >> Apache虛擬主機配置簡單例子

Apache虛擬主機配置簡單例子

編輯:關於Android編程

具體如下:

 

VirtualHost *:80> 
    DocumentRoot "/data/www/test" 
    ServerName test.58tech.com 
    RewriteEngine on 
 
    RewriteEngine on 
    RewriteRule ^/rule$  /rule/ [R] 
    RewriteRule ^/rule/$ /test2013/5033/test/index.shtml [L,PT] 
    RewriteRule ^/signup$  /signup/ [R] 
    RewriteRule ^/signup/$ /s2013/5033/test200545034/index.shtml [L,PT] 
 
    <Directory "/data/www/test"> 
                AllowOverride None 
                Options Includes FollowSymLinks 
                Order allow,deny 
                Allow from all 
                Options +Includes 
                AddType text/html .shtml 
                AddOutputFilter INCLUDES .shtml .inc 
    </Directory> 
    DirectoryIndex /my/test/index/index.shtml 
    #ErrorLog /dev/null 
    #LogLevel crit 
    CustomLog "|/58tech/pkg/apache2/bin/rotatelogs /data/logs/58tech_access_log.%Y%m%d 86400 480" combined 
</VirtualHost> 
 
 
 

實現如下: 


<VirtualHost *:80>
    DocumentRoot "/data/www/test"
    ServerName test.58tech.com
    RewriteEngine on

    RewriteEngine on
    RewriteRule ^/rule$  /rule/ [R]
    RewriteRule ^/rule/$ /test2013/5033/test/index.shtml [L,PT]
    RewriteRule ^/signup$  /signup/ [R]
    RewriteRule ^/signup/$ /s2013/5033/test200545034/index.shtml [L,PT]

    <Directory "/data/www/test">
                AllowOverride None
                Options Includes FollowSymLinks
                Order allow,deny
                Allow from all
                Options +Includes
                AddType text/html .shtml
                AddOutputFilter INCLUDES .shtml .inc
    </Directory>
    DirectoryIndex /my/test/index/index.shtml
    #ErrorLog /dev/null
    #LogLevel crit
    CustomLog "|/58tech/pkg/apache2/bin/rotatelogs /data/logs/58tech_access_log.%Y%m%d 86400 480" combined
</VirtualHost>

 


實現如下  

 http://test.58tech.com  打開: /my/test/index/index.shtml     
 
 
http://test.58tech.com/rule  打開: /test2013/5033/test/index.shtml  地址欄: http://test.58tech.com/rule/ 
 
http://test.58tech.com/signup  打開: /s2013/5033/test200545034/index.shtml  地址欄: http://test.58tech.com/signup/

 http://test.58tech.com  打開: /my/test/index/index.shtml   


http://test.58tech.com/rule  打開: /test2013/5033/test/index.shtml  地址欄: http://test.58tech.com/rule/

http://test.58tech.com/signup  打開: /s2013/5033/test200545034/index.shtml  地址欄: http://test.58tech.com/signup/

 

 

  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved