ApacheはHTTPSからHTTPとHTTPSにリダイレクトされますか?

ApacheはHTTPSからHTTPとHTTPSにリダイレクトされますか?

Apache 2.4で奇妙な動作が発生します。

GET操作を実行するとき:

https://www.example.com/signup 

行く

https://www.example.com/signup -301-> **http**://www.example.com/signup/ -301-> https://www.example.com/signup/ -200-> https://www.example.com/signup/

なぜHTTPSをHTTPにリダイレクトしてから、再びHTTPSにリダイレクトするのかわかりません。

仮想ホストは次のとおりです。

<VirtualHost *:443>
 Servername www.${APACHE_HOSTNAME}
 ServerAlias ${APACHE_HOSTNAME}
 <If "req('Host') == '${APACHE_HOSTNAME}'">
    Redirect permanent / https://www.${APACHE_HOSTNAME}/
 </If>
Alias "/signup" "/var/www/html/"
</VirtualHost>

ありがとう

ベストアンサー1

ServerPath /signup/

この問題を解決しました。

<VirtualHost *:443>
 Servername www.${APACHE_HOSTNAME}
 ServerAlias ${APACHE_HOSTNAME}
 ServerPath /signup/
 <If "req('Host') == '${APACHE_HOSTNAME}'">
    Redirect permanent / https://www.${APACHE_HOSTNAME}/
 </If>
</VirtualHost>

おすすめ記事