1

我有 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>
4

0 回答 0