As per SEO expert I need to have domain url as canonicalurl. As per magento 2 settings doesnt allow it to be empty. attached screenshot shows same. I get https://www.portablerestroomtrailers.com/homepage. It should be https://www.portablerestroomtrailers.com/ enter image description here


Create app/design/frontend///Magento_Cms/layout/cms_index_index.xml

And Add this into it

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <link rel="canonical" src="https://www.yourdomain.com" src_type="url" />
  • there is no folder Magento_CMS. should i create one? Sep 21 '20 at 14:28
  • No need. Just create cms_index_index.xml in any layout folder Sep 21 '20 at 16:01

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.