Forum Discussion

phoneboy's avatar
phoneboy
Director
4 years ago

Customize Error Page for a URL the user cannot access

I have a custom error page with a custom component that I've implemented in my community to display a particular error message when certain content is accessed that they do not have access to.
This works for the most part, but on some parts of the community that are completely inaccessible to the user (e.g. due to permissions), it is not possible to determine what page the user tried to connect to.
I would still like to customize the error message for this URL.

In the custom component, I have tried the following in Freemarker: 

  • coreNode.id, which always returns my top-level community ID, even though the URL clearly indicates it's not at the top-level
  • webuisupport.path.parameters.name.get("gh-p","") which always returns null even though the URL contains this

Is there some way to programmatically determine what URL the user entered?

    • phoneboy's avatar
      phoneboy
      Director

      I forgot I posted this here, and I did ultimately figure this out.
      http.request.url is available and can be parsed with Freemarker in a component included in the Error Page layout.