Answers.Body: <p>There is also this <a href="https://civicrm.org/extensions/disabled-page-redirect" rel="nofollow noreferrer">extension</a> from eileen at fuzion which lets admins set a default Contribution page to handle ones that don't exist any longer</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-30T21:40:13.073Z
Answers.LastActivityDate: 2017-03-30T21:40:13.073Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>This same issue bothers me because I see so many fatal errors in logfiles across multiple servers when all that is happening is that a contribution page has been disabled / removed. I'd love to see it addressed in core if possible; CiviCRM should be capable of handling invalid inputs without showing the end user an unthemed, unhelpful error message.</p>
  
  <p>One extension does already address this - <a href="https://github.com/mlutfy/ca.bidon.reporterror" rel="nofollow noreferrer"><strong>ca.bidon.reporterror</strong></a>. It includes an option to detect those fatal errors (a user hitting a contribution page with invalid ID, or a disabled contribution page, or with an expired session) and redirect them to a default contribution page. This is a big improvement on the default behaviour! However, it's not included in core, and it comes bundled with other behaviours which <em>might</em> not be what all sites want.</p>
  
  <p>Ideally, I'd like to make progress on tickets like <a href="https://issues.civicrm.org/jira/browse/CRM-19157" rel="nofollow noreferrer">CRM-19157: Replace CRM_Core_Error::fatal() with CRM_Utils_System::permissionDenied()</a> so that we can drop the ugly (to users) and noisy (to sysadmins) "fatal" approach to handling invalid inputs in favour of a more "controlled landing" when things go wrong - which can both deliver a helpful and on-brand experience to the user seeing it, and reduce the level of log noise which results from the use of <code>CRM_Core_Error::fatal()</code> as a technique to bail out.</p>
  
  <p>Instead we should deliver be delivering a nuanced experience to both users and admins: where we currently have <code>CRM_Core_Error::fatal()</code> we should throw an exception with information about what went wrong, and then CiviCRM can handle those exceptions appropriately. Broken contribute URL? Direct viewer to a default contribute page! User triggered IDS / DDOS / flood control? Maybe we can dispense with the pretty theme ...</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-30T21:32:46.130Z
Answers.LastActivityDate: 2017-03-30T21:32:46.130Z
Answers.UserDisplayName: Chris Burgess
Body: <p>What happens when an Event is deleted, or a contribution page is disabled, or a profile no longer exists?</p>
  
  <p>Links i am thinking of include</p>
  
  <p>CONTRIBUTION PAGE</p>
  
  <p><a href="http://dmaster.demo.civicrm.org/civicrm/contribute/transact?reset=1&amp;id=14" rel="nofollow noreferrer">http://dmaster.demo.civicrm.org/civicrm/contribute/transact?reset=1&amp;id=14</a>
  You get a yellow page saying</p>
  
  <blockquote>
    <p>Sorry but we are not able to provide this at the moment.
    The page you requested is currently unavailable.</p>
  </blockquote>
  
  <p>EVENT PAGE</p>
  
  <p><a href="http://dmaster.demo.civicrm.org/civicrm/event/register?reset=1&amp;id=18" rel="nofollow noreferrer">http://dmaster.demo.civicrm.org/civicrm/event/register?reset=1&amp;id=18</a></p>
  
  <p>If you are logged out you end up at the home page</p>
  
  <p>PROFILE</p>
  
  <p><a href="http://dmaster.demo.civicrm.org/civicrm/profile/create?gid=19&amp;reset=1" rel="nofollow noreferrer">http://dmaster.demo.civicrm.org/civicrm/profile/create?gid=19&amp;reset=1</a></p>
  
  <p>You get a yellow page saying</p>
  
  <blockquote>
    <p>Sorry but we are not able to provide this at the moment.
    The requested profile (gid=19) is inactive or does not exist.</p>
  </blockquote>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-01T21:45:55.937Z
Comments.Text: Has anyone seen any progress on this issue?  We are in the process of obsoleting one of our longest standing contribution page and google (and several other sites) still show the old one.  I don't just want to turn it off without a good redirect.
Comments.UserDisplayName: Damon Kirkpatrick
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-03-02T04:06:09.533Z
Comments.Text: Did you read my answer below - and maybe give it a +1 while you are there :-). That extension is your friend.
Comments.UserDisplayName: petednz - fuzion
Tags: <civievent><civicontribute><profile>
Title: How can we give Admins more control on what is shown for non-existent pages such as contribution pages
ThreadText: # How can we give Admins more control on what is shown for non-existent pages such as contribution pages
  
  (Asked by: username_0 on 2017-03-30)
  
  What happens when an Event is deleted, or a contribution page is disabled, or a profile no longer exists?
  
  Links i am thinking of include
  
  CONTRIBUTION PAGE
  
  <http://dmaster.demo.civicrm.org/civicrm/contribute/transact?reset=1&id=14>
  You get a yellow page saying
  
  > Sorry but we are not able to provide this at the moment.
  > The page you requested is currently unavailable.
  
  EVENT PAGE
  
  <http://dmaster.demo.civicrm.org/civicrm/event/register?reset=1&id=18>
  
  If you are logged out you end up at the home page
  
  PROFILE
  
  <http://dmaster.demo.civicrm.org/civicrm/profile/create?gid=19&reset=1>
  
  You get a yellow page saying
  
  > Sorry but we are not able to provide this at the moment.
  > The requested profile (gid=19) is inactive or does not exist.
  
  **Tags:** civievent, civicontribute, profile
  
  > **Comments:**
  > **username_1**: Has anyone seen any progress on this issue?  We are in the process of obsoleting one of our longest standing contribution page and google (and several other sites) still show the old one.  I don't just want to turn it off without a good redirect.  
  > **username_0**: Did you read my answer below - and maybe give it a +1 while you are there :-). That extension is your friend.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2017-03-30. Score: 0 | Accepted answer
  
  There is also this [extension](https://civicrm.org/extensions/disabled-page-redirect) from eileen at fuzion which lets admins set a default Contribution page to handle ones that don't exist any longer
  
  
  ---
  
  ### Answer by username_2 on 2017-03-30. Score: 1
  
  This same issue bothers me because I see so many fatal errors in logfiles across multiple servers when all that is happening is that a contribution page has been disabled / removed. I'd love to see it addressed in core if possible; CiviCRM should be capable of handling invalid inputs without showing the end user an unthemed, unhelpful error message.
  
  One extension does already address this - [**ca.bidon.reporterror**](https://github.com/mlutfy/ca.bidon.reporterror). It includes an option to detect those fatal errors (a user hitting a contribution page with invalid ID, or a disabled contribution page, or with an expired session) and redirect them to a default contribution page. This is a big improvement on the default behaviour! However, it's not included in core, and it comes bundled with other behaviours which *might* not be what all sites want.
  
  Ideally, I'd like to make progress on tickets like [CRM-19157: Replace CRM\_Core\_Error::fatal() with CRM\_Utils\_System::permissionDenied()](https://issues.civicrm.org/jira/browse/CRM-19157) so that we can drop the ugly (to users) and noisy (to sysadmins) "fatal" approach to handling invalid inputs in favour of a more "controlled landing" when things go wrong - which can both deliver a helpful and on-brand experience to the user seeing it, and reduce the level of log noise which results from the use of `CRM_Core_Error::fatal()` as a technique to bail out.
  
  Instead we should deliver be delivering a nuanced experience to both users and admins: where we currently have `CRM_Core_Error::fatal()` we should throw an exception with information about what went wrong, and then CiviCRM can handle those exceptions appropriately. Broken contribute URL? Direct viewer to a default contribute page! User triggered IDS / DDOS / flood control? Maybe we can dispense with the pretty theme ...
  
  
  ---
  
  