2

Custom Error Page-1

Problem

You try to visit a protected page that you’re not eligible to view, and don’t see the proper error message you are supposed to see.

Solution

  • Create a custom error page in WP – like http://YourSite.com/error/
  • In the body of that error page, enter something like this:
    Sorry, you do not have access to this content.
    If you are already a member, click here to login.
    If you are not a member yet, then click here to get access.
  • In the above example, link the text “click here to login” to your DAP login page (eg., http://YourSite.com/login/). And link the “get access” text to your sales page.
  • Then take this error page’s URL – which is http://YourSite.com/error/ – and enter it into the “Error Page URL” field of all DAP Products.
  • Also enter this same URL into DAP Admin > Setup > Config > “Error Page URL (Global)”.

Save the changes.

Now, in a different browser, first visit your logout link – http://YourSite.com/dap/logout.php – so that the config changes can be reloaded. Now go back to that original protected page, and you should now be redirected to the above custom error page you created above.

Click Here to Leave a Comment Below 2 comments
Antonio - November 4, 2013

Hi There
Can I have a different Error Page for each product I have?
The Global Error Page is empty and I have adifferent error page per product, but I cannot get the right page to display.
Any suggestions?

Reply
Veena Prashanth - December 4, 2013

1) When a content is protected under multiple products, DAP uses the global ‘error page’ url set in DAP setup -> config -> Error Page URL.

If a post is protected under multiple products, and dap tries to use the global error page url but there is no global error page url set, then dap will use default in-page error url (/dap/product-error.php) as described here:

http://www.digitalaccesspass.com/doc/customizing-error-messages-on-protected-pages/

2) When a content is protected under just 1 product and that product has a product level URL set in DAP products page => Error Page URL, then the product level error page url will be used.

When a content is protected under just 1 product but that product does NOT have a product level URL set in DAP products page => Error Page URL, then the global error page url (dap setup -> config) will be used.

Thanks,
Veena

Reply

Leave a Reply: