サーバー

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

投稿日:2020年1月22日 更新日:

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

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteRule ^old.html https://xxxxx/#ancer [R=301,L,NE]
</IfModule>

-サーバー

関連記事

no image

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

.htaccessにてwwwに統一、かつhttps化 <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} …

no image

httaccessのリダイレクトTIPS

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