2017-12-13 1 views
1

私はバックエンドにゴーストブログエンジンを実行しているウェブサイトを持っています。サブドメインblog.domain.comをゴーストエンジン(localhost:2368)へのプロキシに設定しましたが、Google検索コンソールのサブドメインを確認してblog.domain.com/googlefile.htmlが必要な特定の文字列を返す必要があります同じ文字列はdomain.com/googlefile.htmlから入手できます)。それ、どうやったら出来るの? 私の仮想ホストの設定:ApacheプロキシはすべてのURLを渡し、1つの特定のURLのみを書き換えます

ServerName blog.example.com 
    ServerAlias *.blog.example.com 

    #here is what I tried 
    #RewriteEngine On 
    #RewriteCond %{HTTP_HOST} blog\.example\.com 
    #RewriteRule googlefile.html https://example.com/googlefile.html 

    ProxyPreserveHost On 
    ProxyPass/http://127.0.0.1:2368/ 
    ProxyPassReverse/http://127.0.0.1:2368/ 

Btw。すべてのドメインはhttpsです。

答えて

1

ソリューションは、私がすることができ、プロキシのhttpsのURL SSLProxyEngineを有効にしても、プロキシではmod_rewriteを使用していた

SSLProxyEngine On # enable SSLProxyEngine 
    ServerName blog.example.com 
    ServerAlias *.blog.example.com 

    RewriteEngine On 
    RewriteCond %{HTTP_HOST} blog\.example\.com 
    RewriteRule googlefile.html https://example.com/googlefile.html [P] 

    ProxyPreserveHost On 
    ProxyPass googlefile.html ! # ignore the rewrited url 
    ProxyPass/http://127.0.0.1:2368/ 
    ProxyPassReverse/http://127.0.0.1:2368/ 
URLを無視
関連する問題