2 apache vhosts永久重定向

时间:2012-12-04 23:15:23

标签: apache redirect

我有2个域,我已在2个vhosts文件中单独配置。我需要其中一个域永久重定向到第二个域。在重新加载apache之前,我运行'configtest'并且我得到了“Syntax Ok”。但显然我有一个重定向循环。顺便说一句,该网站是一个drupal安装,不知道这有多少。

这是我的2个conf文件。

[root@prod ~]# cat meh-1_com.conf
<VirtualHost *:80>

    ServerName meh-1.com
    ServerAlias www.meh-1.com
    DocumentRoot    /var/www/html/meh1/

    <Directory /var/www/html/meh1/>
        Options +FollowSymLinks Indexes
        AllowOverride All
        order allow,deny
        allow from all
    </Directory>

    RewriteEngine On
    RewriteOptions inherit
    CustomLog /var/log/httpd/meh1.log combined

</VirtualHost>

<VirtualHost *:443>

    ServerName meh-1.com
    ServerAlias www.meh-1.com
    DocumentRoot    /var/www/html/meh1/

    <Directory /var/www/html/meh1/>
                Options +FollowSymLinks Indexes
                AllowOverride All
                order allow,deny
                allow from all
        </Directory>    

    RewriteEngine On
    RewriteOptions inherit
    CustomLog /var/log/httpd/meh1.log combined

    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile  /etc/httpd/ssl/meh1_com.crt
    SSLCertificateKeyFile   /etc/httpd/ssl/meh1_com.key
    SSLCertificateChainFile /etc/httpd/ssl/meh1_com.ca-bundle.crt
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown

</VirtualHost>

[root@prod ~]# cat meh-2_com.conf 
<VirtualHost *:80>

    ServerName meh-2.com
    ServerAlias www.meh-2.com
    Redirect permanent / http://meh-1.com

</VirtualHost>

<VirtualHost *:443>

        ServerName meh-2.com
        ServerAlias www.meh-2.com
        Redirect permanent / https://meh-1.com

</VirtualHost>

0 个答案:

没有答案