magento2: 404 no-route on all pages added from CMS

Anytime I add a new CMS page from the admin dashboard, it Magento generates a no-route 404 page not found error. After days of meticulous troubleshooting across multiple installs and versions of Magento 2.x.x, I’ve discovered a one way to get the pages to load.

After creating the page and saving it from cms/page/new. I have to go back to /cms/page/index, select layout, assign a new layout (like changing from 2 columns with right bar, to 1 column), and Save. Then select Action > View. Only after following that specific sequence will any CMS page load.

I’ve tested this in both developer and production modes. Currently tested this on Magento v2.1.10-rc2, Ubuntu 14.04, Nginx, and PHP 7.0.6.

Preconditions

Magento v2.1.10-rc2, Ubuntu 14.04, Nginx, and PHP 7.0.6.

Steps to reproduce

  1. Install Magento from develop branch on a Ubuntu 14.04 LEMP stack.
  2. Add a new page from the CMS …cms/page/new…
  3. Enter content, page title, layout, etc.
  4. Save and view.

Expected result

  1. Load the page

Actual result

  1. Magento no-route 404 Page Not Found.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 12
  • Comments: 40 (5 by maintainers)

Commits related to this issue

Most upvoted comments

4 months later, this is still open. ~ I solved this and many other bugs by switching back to magento 1

This worked for our 2.1 CE installation.

  1. Disable single store mode (admin>stores>configuration>general>general)
  2. Assign a store view to the CMS page.
    • go to your cms pages ( admin>content>pages)
    • edit the page which gives you the 404 message
    • Set the store view to “All Store Views”
    • save the page
  3. enable single store mode(admin>stores>configuration>general>general)
  4. refresh cache (admin>system>cache management)

Okay more info. This is only happening in single store mode for me. Disabling single store mode forces you to define the relationship by selecting a view when adding a new page (all store views, default store view, etc). Therefore it updates the cms_page_store table fine.

Is this supposed to happen in single store mode? Or am I missing a setting somewhere?

Went to fix this today and found the issue is resolved in the develop branch upstream. CMS is now using it’s repository to save too. Fingers crossed for this being closed on next release then!

I have the same issue. Earlier CMS pages are working fine but now if i create a new CMS page then it gives 404. I check in the database. New page is in cms_page table but link with cms_page_store. How to solve this?

I made an alternative solution for this

  • Disable single store mode (admin > stores > configuration > general > general > single-store mode) and select “No”.
  • Assign a store view to the CMS page.
  • go to your cms pages ( admin > content > pages)
  • edit the page which gives you the 404 message
  • Set the store view to “Default Store Views”
  • save the page
  • refresh cache (admin > system > cache management) Now the CMS page is save to table “cms_page_store”. and pages are working.

Experiencing the same issue here. Visiting cms/page/view/page_id/{page_id} also doesn’t work so it’s not a rewrite problem.

A little bit of digging around shows that the new page somehow is only added to the cms_page table but not cms_page_store which means it doesn’t belong to any store so it won’t load. If I manually add the relationship in cms_page_store and refresh the page cache, the page loads.

So…is it Magento at fault here or is it my setup?

(2.0.1-rc3, ubuntu 14.04, nginx, and php 7.0.7)

Reopen the ticket same issue is verified in mage 2.2.1 on a single store, don’t save any block

Same problem experienced here! Magento 2.1.3 A nice workaround for people who want to stay in single store mode.

  1. Create the CMS page
  2. Save the page
  3. Go to the pages overview (list/index of al your CMS pages)
  4. Click on the created page by title or url
  5. Quick editor opens
  6. Just click save without anything edited
  7. Page activated 😃

having same issue of being able to save pages edits. get 404 when pasting in large bits of content but will save if I break it up into smaller bits. same content…just split up. 404 on frontend for the url. Magento 2.1.0 single store mode. the admin 404 was due to a mod security setting on the nexcess host. still trying to figure out the frontend 404.