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>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章