0

I want my node page turned off. I don't want mysite/node/3 to work. I want it to display 404. I tried rabbit hole and it worked but the problem ws that it also stopped the aliases from working.

Is there a solution where I can turn off the node/whatever but keep my aliases?

0

I'm guessing you're on drupal 7?

Rather than trying to disable/show a 404 you could install this module: https://www.drupal.org/project/globalredirect

That will make it so that if anyone tries to access one of the "node/*" urls they will be automatically be redirected to the proper alias of the page. Would that work for what you need?

2
  • I'm on Drupal 8. I would prefer it not exist at all. I don't want people to know the site uses Drupal is the goal. – Josh Tango Oct 13 '18 at 10:39
  • Could I use this module to redirect to 404? – Josh Tango Oct 13 '18 at 11:22
-1

You can check the path in a preprocess function using this algorithm:

If current route is /node/* and current route is not an admin/config path then

Redirect to 403 page

End if

1
  • I am not a php programmer so is there a way to do that using the site admin? – Josh Tango Oct 11 '18 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.