最初の URL を 2 番目の URL にリダイレクトする方法はありますか?
http://www.example.com/podcast/episode.html
http://www.example.com/podcast/episode
同じページの重複コピーとして表示されないように、.html 拡張子を非 HTML バージョンの URL に強制的にリダイレクトする方法はありますか。
現時点での私のhtaccessコードは次のとおりです。
RewriteEngine On
RewriteBase /
#removing trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ $1 [R=301,L]
#non www to www
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
#shtml
AddType text/html .html
AddHandler server-parsed .html
#html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.html [NC,L]
#index redirect
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
RewriteRule ^index\.html$ http://example.com/ [R=301,L]
これは可能ですか?