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/

目录
相关文章
|
Linux 网络安全 Apache
CentOS 7.2配置Apache服务httpd(上)
CentOS 7.2配置Apache服务httpd(上)
757 1
|
存储 分布式计算 druid
大数据-152 Apache Druid 集群模式 配置启动【下篇】 超详细!(一)
大数据-152 Apache Druid 集群模式 配置启动【下篇】 超详细!(一)
166 1
大数据-152 Apache Druid 集群模式 配置启动【下篇】 超详细!(一)
|
缓存 前端开发 应用服务中间件
CORS跨域+Nginx配置、Apache配置
CORS跨域+Nginx配置、Apache配置
603 7
apache+tomcat配置多站点集群的方法
apache+tomcat配置多站点集群的方法
142 4
|
消息中间件 分布式计算 druid
大数据-152 Apache Druid 集群模式 配置启动【下篇】 超详细!(二)
大数据-152 Apache Druid 集群模式 配置启动【下篇】 超详细!(二)
140 2
|
负载均衡 应用服务中间件 Apache
Tomcat负载均衡原理详解及配置Apache2.2.22+Tomcat7
Tomcat负载均衡原理详解及配置Apache2.2.22+Tomcat7
198 3
|
存储 消息中间件 druid
大数据-151 Apache Druid 集群模式 配置启动【上篇】 超详细!
大数据-151 Apache Druid 集群模式 配置启动【上篇】 超详细!
235 1
|
Linux PHP Apache
CentOS 7.2配置Apache服务httpd(下)
CentOS 7.2配置Apache服务httpd(下)
166 1
|
存储 Apache 开发工具
apache的主要目录结构及常见的配置选项的详细说明(图例展示)
apache的主要目录结构及常见的配置选项的详细说明(图例展示)
309 1
|
Web App开发 应用服务中间件 网络安全
如何在 Apache 和 Nginx 上配置 OCSP Stapling
如何在 Apache 和 Nginx 上配置 OCSP Stapling
440 9

推荐镜像

更多
下一篇
开通oss服务