2017-09-25 13 views
0

URLにhttpsがある場合、あるドメインから別のドメインにリダイレクトできません。エラーHTTPSでドメインを別のドメインにリダイレクト

私はこのコードでhtaccessを経由して安全に管理する。これによりhttps://www.mywebsite2.com

ドメインにreinderedしなければならないドメインhttp://www.mywebsite1.netに行われたすべての要求を処理する必要があり、次のとおりです。

RewriteEngine on 
RewriteRule ^(.*)$ https://www.mywebsite2.com/$1 [R=301,L] 

問題は、SSL証明書が何リットルではありませんので、URLは、このhttps://www.mywebsite1.netエラーページ

NET :: ERR_CERT_COMMON_NAME_INVALID 

に到着した場合ということです以前のドメインにインストールされたonger。だから私はこの問題をどのように扱うのですか?

私は十分にはっきりしていたと思います。 ありがとうございます

答えて

0

SNI、Server Name Indicationを見てください。ブラウザがそれをサポートしている場合は、youreのに応じてバーチャルホストを作成することができます(詳細:https://wiki.apache.org/httpd/NameBasedSSLVHostsWithSNI)を必要とするすべての近代的なブラウザでは、この機能をサポートして

# Ensure that Apache listens on port 443 
    Listen 443 

    # Listen for virtual host requests on all IP addresses 
    NameVirtualHost *:443 

    # Go ahead and accept connections for these vhosts 
    # from non-SNI clients 
    SSLStrictSNIVHostCheck off 

    <VirtualHost *:443> 
     # Because this virtual host is defined first, it will 
     # be used as the default if the hostname is not received 
     # in the SSL handshake, e.g. if the browser doesn't support 
     # SNI. 
     DocumentRoot /www/example1 
     ServerName www.mywebsite1.net 

     # Other directives here 

    </VirtualHost> 

    <VirtualHost *:443> 
     DocumentRoot /www/example2 
     ServerName www.mywebsite2.com 

     # Other directives here 

    </VirtualHost> 

を。そうでないと、HTTPヘッダー部分が暗号化されているので、あなたは立ち往生しています。早急に正しい仮想ホストを選択する方法はありません。

関連する問題