<VirtualHost *:80> DocumentRoot /var/www/html/hoge.com/public_html ServerName hoge.com ServerAlias www.hoge.com RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^/(.*) https://hoge.com/$1 [R=301,L] AddDefaultCharset UTF-8 <Directory "/var/www/html/hoge.com"> Require all granted </Directory> </VirtualHost> <VirtualHost *:443> DocumentRoot /var/www/html/hoge.com/public_html ServerName hoge.com ServerAlias www.hoge.com RewriteEngine on RewriteCond %{HTTP_HOST} ^www.hoge.com$ RewriteRule ^/(.*) https://hoge.com/$1 [R=301,L] AddDefaultCharset UTF-8 <Directory "/var/www/html/hoge.com"> Require all granted </Directory> </VirtualHost>
上記のような設定をし、httpsのwwwなしへ全てリダイレクトさせるように設定しました。
リダイレクト自体は問題なく行われますが、
http://www.hoge.com
からリダイレクトした時のみ
https://hoge.com//
と末尾にスラッシュが二つ付いてしまいます。
これを無くしたいのですが、何か方法はありますでしょうか。
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/05/23 15:36