Apache 配置域名 重定向,apache重定向


step1:

去掉LoadModule rewrite_module modules/mod_rewrite.so的#

step2:

修改所有的 AllowOverride none 为AllowOverride all

step3:

然后在对应的目录下面:

www.test.gov.cn 跳转到

<VirtualHost *>
         ServerName www.test.gov.cn

         ServerAlias www.test.gov.cn  //别名 一般是需要过滤的域名
         DocumentRoot /cicro/wcm/vhosts/www.test.gov.cn/ROOT
         Alias /manager "/cicro/wcm/vhosts/common/manager//"
         Alias /wcm.files/ "/cicro/wcm/wcm.files//"
         JkMountFile   /cicro/wcm/as/apache/conf/uriworkermap.properties
         <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteCond %{HTTP_HOST} ^www.test.gov.cn [NC]
        RewriteRule ^(.*) http://www.目标.gov.cn/ [L]
</IfModule>
 </VirtualHost>

相关内容

    暂无相关文章