-
Junior Member
301 Redirection of index, index.php, index.html
I have noticed that my website is using three files.
https://www.example.com/index
https://www.example.com/index.html
https://www.example.com/index.php
Because of "duplications" problem, I want to redirect all these files to the main domain https://www.example.com, by using htaccess
Anyone has an idea about the code snippet that I can use it for this purpose?
Regards
-
Junior Member
It seems that this piece of code
{if $pageInfo.canonical}
<link rel="canonical" href="{$pageInfo.canonical}" />
Would produce any page with the same title of the page, therefore, when we write www.example.com/index, then the canonical is index, if the title is index.html, then the canonical is index.html,..and so on. However, index.html, index,php and index should be referring to the same root domain name, www.example.com. How we can modify this piece of code which is availebl on the (....templates/your template/tpl/head.tpl) so any index file can refer to the main domain only to overcome duplications problem in google and for SEO optimization.
Any ideas.