Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
mysite.com から mysite.com/folder にトラフィックをリダイレクトしたいのですが、すべてのページで SSL も強制します。
現在、どこかのサンプルから見つけた httpd.conf にこれがありますが、常に正しく機能しているとは思いません。
RewriteEngine on RewriteRule ^/$ https://www.mysite.com/folder/ [R]
は^/$、リクエストが正確に/、つまりサイトのルートである場合にのみ一致します。それ以外のものは一致しません。.*代わりに試してください。
^/$
/
.*
注: この書き換えルールが HTTP バージョンと HTTPS バージョンの両方で有効になっている場合、無限のリダイレクト ループに陥ります。その場合、ある種の RewriteCond テストも必要になる場合があります。