set up a workflow on the page for when condition is true. the condition can be where get data X from page URL is empty, then the action can be go to page 404