Thanks. it works.
But how can I show a prompt which says "Please login" instead of an blank page?
I am setting up an internal forum which should only allow logined users to view all the posts.
What should I do to make each page redirected to the login page if not logined?