.htaccessで以下のように301リダイレクトするには、どのように書けば良いでしょうか。
http://example.com/old/180101_01.html
↓
http://example.com/new/100
Redirect 301 /old/180101_01.html /new/100
このように書くと
http://example.com/old/180101_01.html
↓
http://example.com/new/100.html
というように、余計な拡張子「.html」が最後に付いてしまいます。
他にもたくさん転送するURLがあるため、まとめて書きやすい方法があるととても助かります。
http://example.com/old/180201_01.html
↓
http://example.com/new/300
http://example.com/old/180301_01.html
↓
http://example.com/new/500
・
・
・
### ◆追記
.htaccessの内容は下記の通りです。
大事な前提を書いていませんでした。WordPressのサイトです。そのためhtaccessにWordPressのための記述があります。
(# BEGIN WordPress から# END WordPressまで)
また、最初の方は、使っているレンタルサーバーでWordPressを動かすために必要な記述です。
AddHandler x-httpd-php5619 .php suPHP_ConfigPath /home/ユーザーディレクトリのパス <FilesMatch "^(.htaccess|.htpasswd|php.ini|.*.sql|.*.log|.*.cron|.*.inc|.*.phps|.*.yml)$"> Deny from all </FilesMatch> Options +SymLinksIfOwnerMatch # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Redirect 301 /old/180101_01.html /new/100 Redirect 301 /old/180201_01.html /new/300 Redirect 301 /old/180301_01.html /new/500