Avoid access denied page after user logout I am using Drupal 7. It is good that when user is logged out and again he access the 

user/logout 


link he is redirected to Access denied page.

Now I want that instead of Access denied page, i want to redirect to the specific page.

Can i achieve it using rules module or i have to write the code for that
What you want is something called 403 redirect to Login:
https://drupal.org/project/r4032login

403 access denied messages will get redirected to the login page. I've used this before and it works nicely.