サーバー

.htaccessにてwwwに統一、かつhttps化

投稿日:

.htaccessにてwwwに統一、かつhttps化

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^hoge\.co\.jp
RewriteRule (.*) http://www.hoge.co.jp/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</IfModule>

-サーバー

関連記事

no image

httaccessのリダイレクトTIPS

◆同サーバー内でのリダイレクト 1.特定ページへのリダイレクト ▼https://example.com/page.htmlからhttps://example.com/new-page.htmlへ転送 …

no image

htaccessでアンカー付きURLへリダイレクト

アンカーの#などは、URLエンコードされてしまう。 NEフラグを付けると、URLエンコードされない。