Jump to content

Duplicate Title/Meta Description due to removal of .html extension


Recommended Posts

Fortunately I have not been plagued with too many of the duplicate errors due to controller but I have not found this exact problem with regards to duplicate content here.

 

I am showing over 200 duplicate title tags and meta descriptions in GWT due to the removal of the .html extension:

 

For example:

 

GATSBY Duvet Set - Whispar Design

 

url_icon.png/duvet-bedding/36-gatsby-duvet-set.html

 

url_icon.png/duvet-bedding/36-gatsby-duvet-set

 

I assumed Prestashop would add a directive in the .htaccess file to avoid this problem but I am not seeing it and Google is seeing both versions. Needless to say I am getting a lot of 404 errors for the .html extension version of the pages. I tried adding a standard rewrite condition for html to non-html redirect but it did not work as desired.

 

Any thoughts on how to correct this issue or know the proper .htaccess rule before Google puts me in time out?

Edited by Whispar1 (see edit history)
Link to comment
Share on other sites

Thanks for the link DH.

That is the one I tried and it did not redirect. I even tried the other two listed and still not redirecting.

I did add the canonical code into the header - forgot to do that anyway so thanks for the reminder.

 

This rule does the trick - slight variation of the one posted at stackexchange

 

 

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_URI} \.html$

RewriteRule ^(.*)\.html$ /$1 [R,L]

Edited by Whispar1 (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...