Most of the pages in the module I am building inherit from a single master page which contains common functions that all my pages share. I need to be able to access those functions from the rest of the pages with URL's like this (this is especially important for jquery):
To do that i used:
Director::addRules(100, array( 'masterpage' => 'masterpage_Controller', ));
But this also means users can type in this:
And navigate directly to my master page which shows a blank page without any content. It would be great if this page returned a 404 error instead or redirected people to the mainpage
I don't want to put in any code in the master page that could do that, as it would also affect all the other pages (I.E: if I placed ContentController::httpError(404) in there, then all my pages would return a 404)
Is there some way to tell silverstripe "don't let anyone go to this specific URL"?