MaxiNet
MaxiNet

Reputation: 1028

Drupal7: show 404 page after checks in preprocessing

I have some checks in my preprocessing files for nodes. If one of them is true I would like to show my defined 404 page. How is this possible with a php call?

Upvotes: -1

Views: 483

Answers (2)

Raniel
Raniel

Reputation: 91

Use this code:

if([YOUR_CHECKS]){
    drupal_not_found();
}

Upvotes: 1

Bhavin Joshi
Bhavin Joshi

Reputation: 522

You should use the drupal_not_foun() function

Upvotes: 0

Related Questions