Forum Discussion
I believe the coreNode object gets created based on the "node" that is installed for the page you are viewing. I think in the case of a NNF error, you the request has already been sent (either redirected or forwarded, don't remember which) to the "404 page" which has the community set as the coreNode.
I don't think we currently have a way in common.init to tell what node was trying to be hit when the 404 page was served.
If you control the initial redirect to the page that is getting the NNF error, you could make a REST API call as that user to look up the node (board or category) for the page you are about to redirect to and redirect elsewhere if that returns as "not found".
Another thing you could try is adding some javascript (client-side) logic that checks the http status code of the response -- it will be 404 in this case and then you could possibly parse the board or category id out of the URL. In addition to that possibly looking strange to the end-user, it seems like that might be a bit error-prone and could break if URL schemes change or a new one is added.
Related Content
- 5 months ago
- 30 days ago
- 3 years ago