Apache虚拟主机配置简单例子

文章地址: http://blog.csdn.net/5iasp/article/details/9221679

 

具体如下:

 

<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/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值