Is there a way to redirect the first URL to the second URL?
http://www.example.com/podcast/episode.html
http://www.example.com/podcast/episode
Is there a way to force the .html extension to redirect to a non-html version of the URL so that it doesn't appear as duplicate copies of the same page.
Currently my htaccess code is:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ $1 [R=301,L]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
AddType text/html .html
AddHandler server-parsed .html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^\.]+)$ $1.html [NC,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
RewriteRule ^index\.html$ http://example.com/ [R=301,L]
Is it possible?
source
share