I have developed a module that creates a certain set of pages. What I would like to do is create a specific redirect for those pages if they are not found while keeping the generic Drupal 7 wide redirect for all other pages. Is this possible and how would I go about doing it?


  • Why would pages you have created not be found? Do you have something like myurl/<someID>, where not all possible <someID> values exist? – rooby May 11 '13 at 8:49
  • The pages are created depending on user actions. So in some instances the page may not exist yet and instead of displaying a 404, I would rather redirect them to the appropriate page. – user5013 May 13 '13 at 15:37

I suggest to try the Redirect or rules module.


You can create URL redirects manually for each of these pages, but the Redirect module makes this much easier.

  • Go to "Configuration > Search and metadata > URL redirects > Fix 404 pages" (admin/config/search/redirect/404).

So, you can see that there are a few paths that I have tried to access that do not exist. Next, to each one there is an "Add redirect" operation.

  • Click "Add redirect"

When Clicking on "Add redirect" link we can specify where we would like users to be redirected when they reach the page that does not exist.

See more how to Fix 404 Pages Using redirect Module.

  • 1
    The rules module would be the best generic solution I think. – user5013 May 13 '13 at 15:38
  • How can we can page not found event in Rules? – AgA Aug 23 '13 at 10:31
  • 1
    Can you expand this a little bit to describe how these two modules can solve the problem? – mpdonadio Aug 23 '13 at 11:10

You can try by going on "admin/config/system/site-information"page. There you can give links where to redirect on the "Default 403 (access denied) page" and "Default 404 (not found) page". For example if you type "node", it will take you to front page.

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.