¿Cómo redirigir la extensión html usando htaccess?
Por el momento, estos dos enlaces muestran la misma página:
http://www.example.com/podcast/episode.html
http://www.example.com/podcast/episode
Lo que quiero hacer es redirigir todos los enlaces de tipo html a los enlaces no html.
Sé que esto puede parecer sencillo de hacer con htaccess, pero no funciona para mí.
Aquí está mi código htaccess hasta ahora:
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]