0

I created a CMS page named Cookie but when I save it with the key URL "cookie" it cannot save and shows an error

enter image description here

2 Answers 2

1

This is showing due to URL key(cookie) already exist, Please change URL key for the new cookie page.

2
  • I used the SEO module and when I went to the URL Rewrite section, I didn't see any /cookie used.
    – PhanHuy
    Commented Oct 4, 2023 at 12:48
  • check url from here, Admion -> Marketing -> SEO&Search -> URL Rewrites.
    – MP Raj
    Commented Oct 4, 2023 at 12:53
1

The cause for that is that the URL key already in use somewhere else in Magento. To solve this, you should navigate to your admin CMS page, click on on the Search Engine Optimization tab, and update the URL key. Choose a new unique URL key instead of Cookie, and then page will be created.

6
  • I used the SEO module and when I went to the URL Rewrite section, I didn't see any /cookie used.
    – PhanHuy
    Commented Oct 4, 2023 at 12:48
  • 1
    Actually Magento use the "cookie" as a path by default in core files. So you are not allowed to use it again. File Path in which it was used : vendor\magento\module-cms\Observer\NoCookiesObserver.php Commented Oct 4, 2023 at 13:18
  • But i really want to create cms page with key url is "/cookie", you know how to do it ?
    – PhanHuy
    Commented Oct 5, 2023 at 1:28
  • To achieve this, you have to disable the Magento_Cookie module which is not advisable, as doing so may create additional issues, especially since there are dependent modules such as Magento_GoogleAnalytics, Magento_GoogleGtag, and Magento_GoogleOptimizer. Disabling the cookie module could also disrupt user logins. Instead, a recommended approach is to add a specific value before the slash, like "/xxx/cookie." Commented Oct 5, 2023 at 7:46
  • i saw in module-cookie have file routes.xml in folder etc/frontend, inside routes file have frontName is "cookie". I change that frontName to another name and then i can save cms page with url is "cookie". Should i do that?
    – PhanHuy
    Commented Oct 9, 2023 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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