Answers.Body: <p>So, I missed the part in the documentation that says you should really have AllowOverride not set to None in the Apache http configuration file for .htaccess. I went and did a fresh install (preserving everything via backup of course) and ran into some similar errors there just when trying to set my permalink structure to just %post_name%. Still running into a weird issue with CiviCRM system status page not displaying, and the Stripe payment text field is like a pixel high now (no idea how that one happened yet), but my 404 error has been resolved.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-15T13:19:15.057Z
Answers.LastActivityDate: 2022-05-15T13:19:15.057Z
Answers.UserDisplayName: Michael Matthews
Body: <p>So, I already solved this before (<a href="https://civicrm.stackexchange.com/questions/41664/resolved-review-your-contribution-returns-a-404-after-it-worked-before-on-civ">RESOLVED: &quot;Review your contribution&quot; returns a 404 after it worked before on CiviContribute Member Contribution page</a>), but it seems to have come back with a minor vengeance. WordPress 5.9.3, CiviCRM now 5.48.0. I did an extension update of Stripe this weekend which had issues. The resolution there was to change the old base page of 'crm' (last time this happened, I did that because someone probably me accidentally deleted the blank civicrm WordPress page) was changed to a new base page of 'civicrm' so it was back to the default name. Oddly, while that fixed the Stripe payment processing contribution page (and may have broken events, not sure) that caused URLs to use civicrm-2, which turned out to be because the original base page was chosen as Welcome at install time way back when because that's the only page that was there, which I guess updated the post_name to civicrm, so the new civicrm got -2 added to it? Would be nice to be able to edit that within WordPress, but I guess that's what phpMyAdmin is for. In any event, I cleared out all old civicrm pages, flipped the base page to a temporary one, then flipped it back to civicrm (flushing cache every time I changed that, in the unconfirmed thought that this is necessary), hoping that would do what needed to be done.</p>
  <p>But now, every single CiviCRM URL gives a 404. Shortcodes in WordPress pages seem to work. But of course that's not going to work out too well as the original problem from before -- review your contribution returns a 404 -- is back.</p>
  <p>But, the fix that worked before isn't working. So, what ELSE could be going on here? Does the post_name not matter so much as ... something else?</p>
  <p>The website is <a href="https://members.marylandtesla.com" rel="nofollow noreferrer">https://members.marylandtesla.com</a>. Try to become a member and you get a 404 on the review contribution step. The upcoming events (which the Civi event widget isn't actually showing a new test event while it does show up with a shortcode in a page, not sure if that's a clue) all give 404s too unless I use specific shortcodes.</p>
  <p>So far just typing this up hasn't given me any more ideas to see what's going on. Help?</p>
  <p>Here's the base page config to prove it's there:</p>
  <p><a href="https://i.sstatic.net/cJgVI.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/cJgVI.png" alt="base page config" /></a></p>
  <p>Thanks.</p>
  <p>Michael</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-11T23:58:21.330Z
Comments.Text: This is an odd url format: `https://members.marylandtesla.com/index.php/become-a-tesla-club-member` with both index.php and the clean page name. Check that clean urls are configured properly (https://docs.civicrm.org/sysadmin/en/latest/integration/wordpress/clean-urls/) and that .htaccess doesn't have some weird rewrite rule.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-12T00:49:59.193Z
Comments.Text: That become-a-member page is a WordPress page with a shortcode. That part displays, but the Review Contribution then uses the /index.php/civicrm/... URL format which gives a 404. This is the default configuration. My permalink setting is default, /index.php/%year%/%monthnum%/%day%/%postname%/. Changing that breaks just about everything, I found out before. The test-drive straight contribution link is https://members.marylandtesla.com/index.php/civicrm/contribute/transact/?reset=1&id=2&action=preview . This all worked before. .htaccess files look to be default too, nothing weird that I can see.
Comments.UserDisplayName: Michael Matthews
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-12T14:02:59.893Z
Comments.Text: Now that the reason I tried to switch back to the default 'civicrm' base page has been resolved (thanks to Matt Wire), I flipped that back to 'crm,' tried to restore the post_title of the original Welcome page back to civicrm and the attempted new base page back to civicrm-2 in case there's something else hardcoded there, and ... still get 404s on any /index.php/crm/ URL.
Comments.UserDisplayName: Michael Matthews
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-12T23:58:08.033Z
Comments.Text: Enabled some WordPress debug plugins and made some progress. Not getting 404s any more at least. However, going to the system status page gives me a blank page where I was expecting to see various items (including the Stripe web hook update I need to resolve that way). Seeing a whole bunch of this error in the plugin debug output (which I could not find anywhere else): Document is empty in /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Menu.php on line 95. Haven't found anything else about that yet.
Comments.UserDisplayName: Michael Matthews
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-13T14:08:20.340Z
Comments.Text: Enabled some WP debugging, and based on this query:
  SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND (wp_posts.ID = '0') AND wp_posts.post_type = 'page' ORDER BY wp_posts.post_date DESC
  it does seem like CiviCRM's hook to process requests isn't working here. But why? What else is needed beyond setting the base page and clearing the cache?
Comments.UserDisplayName: Michael Matthews
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-13T14:26:20.357Z
Comments.Text: `wp_posts.ID = '0'` doesn't look right. That would always return nothing right? Is that supposed to be the basepage id?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-13T15:24:23.070Z
Comments.Text: That’s what I got when I tried to view an event, and the URL was the expected one. Note that this also started to work — briefly — seemingly just by me enabling some debugging plugins. Then it stopped working. But why would that query even occur as the URL was not supposed to be a WP page?
Comments.UserDisplayName: Michael Matthews
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-13T23:07:18.610Z
Comments.Text: Tried a minor Hail Mary to update CiviCRM to 5.49.1. Update successful, didn't resolve my issue though.
Comments.UserDisplayName: Michael Matthews
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-14T17:18:24.767Z
Comments.Text: I can see that the rewrite rule matching "^civicrm/([^?]*)?" has the same format (with correct page ID) as another working system, so that's not it.
Comments.UserDisplayName: Michael Matthews
Tags: <civievent><civicontribute><base-page>
Title: What are all the reasons a CiviCRM URL would return a 404?
ThreadText: # What are all the reasons a CiviCRM URL would return a 404?
  
  (Asked by: username_0 on 2022-05-11)
  
  So, I already solved this before ([RESOLVED: "Review your contribution" returns a 404 after it worked before on CiviContribute Member Contribution page](https://civicrm.stackexchange.com/questions/41664/resolved-review-your-contribution-returns-a-404-after-it-worked-before-on-civ)), but it seems to have come back with a minor vengeance. WordPress 5.9.3, CiviCRM now 5.48.0. I did an extension update of Stripe this weekend which had issues. The resolution there was to change the old base page of 'crm' (last time this happened, I did that because someone probably me accidentally deleted the blank civicrm WordPress page) was changed to a new base page of 'civicrm' so it was back to the default name. Oddly, while that fixed the Stripe payment processing contribution page (and may have broken events, not sure) that caused URLs to use civicrm-2, which turned out to be because the original base page was chosen as Welcome at install time way back when because that's the only page that was there, which I guess updated the post\_name to civicrm, so the new civicrm got -2 added to it? Would be nice to be able to edit that within WordPress, but I guess that's what phpMyAdmin is for. In any event, I cleared out all old civicrm pages, flipped the base page to a temporary one, then flipped it back to civicrm (flushing cache every time I changed that, in the unconfirmed thought that this is necessary), hoping that would do what needed to be done.
  
  But now, every single CiviCRM URL gives a 404. Shortcodes in WordPress pages seem to work. But of course that's not going to work out too well as the original problem from before -- review your contribution returns a 404 -- is back.
  
  But, the fix that worked before isn't working. So, what ELSE could be going on here? Does the post\_name not matter so much as ... something else?
  
  The website is <https://members.marylandtesla.com>. Try to become a member and you get a 404 on the review contribution step. The upcoming events (which the Civi event widget isn't actually showing a new test event while it does show up with a shortcode in a page, not sure if that's a clue) all give 404s too unless I use specific shortcodes.
  
  So far just typing this up hasn't given me any more ideas to see what's going on. Help?
  
  Here's the base page config to prove it's there:
  
  [![base page config](https://i.sstatic.net/cJgVI.png)](https://i.sstatic.net/cJgVI.png)
  
  Thanks.
  
  Michael
  
  **Tags:** civievent, civicontribute, base-page
  
  > **Comments:**
  > **username_1**: This is an odd url format: `https://members.marylandtesla.com/index.php/become-a-tesla-club-member` with both index.php and the clean page name. Check that clean urls are configured properly (https://docs.civicrm.org/sysadmin/en/latest/integration/wordpress/clean-urls/) and that .htaccess doesn't have some weird rewrite rule.  
  > **username_0**: That become-a-member page is a WordPress page with a shortcode. That part displays, but the Review Contribution then uses the /index.php/civicrm/... URL format which gives a 404. This is the default configuration. My permalink setting is default, /index.php/%year%/%monthnum%/%day%/%postname%/. Changing that breaks just about everything, I found out before. The test-drive straight contribution link is https://members.marylandtesla.com/index.php/civicrm/contribute/transact/?reset=1&id=2&action=preview . This all worked before. .htaccess files look to be default too, nothing weird that I can see.  
  > **username_0**: Now that the reason I tried to switch back to the default 'civicrm' base page has been resolved (thanks to Matt Wire), I flipped that back to 'crm,' tried to restore the post_title of the original Welcome page back to civicrm and the attempted new base page back to civicrm-2 in case there's something else hardcoded there, and ... still get 404s on any /index.php/crm/ URL.  
  > **username_0**: Enabled some WordPress debug plugins and made some progress. Not getting 404s any more at least. However, going to the system status page gives me a blank page where I was expecting to see various items (including the Stripe web hook update I need to resolve that way). Seeing a whole bunch of this error in the plugin debug output (which I could not find anywhere else): Document is empty in /var/www/html/wp-content/plugins/civicrm/civicrm/CRM/Core/Menu.php on line 95. Haven't found anything else about that yet.  
  > **username_0**: Enabled some WP debugging, and based on this query: SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND (wp_posts.ID = '0') AND wp_posts.post_type = 'page' ORDER BY wp_posts.post_date DESC it does seem like CiviCRM's hook to process requests isn't working here. But why? What else is needed beyond setting the base page and clearing the cache?  
  > **username_1**: `wp_posts.ID = '0'` doesn't look right. That would always return nothing right? Is that supposed to be the basepage id?  
  > **username_0**: That’s what I got when I tried to view an event, and the URL was the expected one. Note that this also started to work — briefly — seemingly just by me enabling some debugging plugins. Then it stopped working. But why would that query even occur as the URL was not supposed to be a WP page?  
  > **username_0**: Tried a minor Hail Mary to update CiviCRM to 5.49.1. Update successful, didn't resolve my issue though.  
  > **username_0**: I can see that the rewrite rule matching "^civicrm/([^?]*)?" has the same format (with correct page ID) as another working system, so that's not it.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2022-05-15. Score: 1
  
  So, I missed the part in the documentation that says you should really have AllowOverride not set to None in the Apache http configuration file for .htaccess. I went and did a fresh install (preserving everything via backup of course) and ran into some similar errors there just when trying to set my permalink structure to just %post\_name%. Still running into a weird issue with CiviCRM system status page not displaying, and the Stripe payment text field is like a pixel high now (no idea how that one happened yet), but my 404 error has been resolved.
  
  
  ---
  
  