I have two home pages in magento 2. One abc.com and another abc.com/index.php

  • How can I get rid of this duplication?
  • How can I set canonical for homepage in magento 2?

1 Answer 1


Good way to add rule in .htaccess for index.php, but if you want to add canonical its also quite simple just edit home page (content->pages->home)and update layout for home page as mentioned in the following image:-

enter image description here

      <link rel="canonical" src="https://www.hayacreations.com/" src_type="url"/>

resulting output will be:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.