Prevent acessing urls under certain conditions