Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 330267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:39:55+00:00 2026-05-12T09:39:55+00:00

I would like to know what is the best practice for informing a user

  • 0

I would like to know what is the best practice for informing a user that their access attempt was denied. I realize there are probably more options, but these are the methods I’m considering:

  1. Inform a user on a dedicated “Access Denied” page reached when my script redirects them via header(“Location:”)
  2. Inform a user in message in the requested dynamic page

I’d like to know the pros vs cons. Currently I can come up with these:

  1. Pro for redirection : possibly more obfuscated?
  2. Pro for message in requested page : less requests on the HTTP server?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:39:55+00:00Added an answer on May 12, 2026 at 9:39 am

    Redirect to an error page or an error controller/action in the current request( if you are using some MVC-structure).

    And also make sure that you send the correct HTTP headers(code 401 is the right one for access denied) so that a search robot or similar understands what’s going on.

    1. Pro for redirection : possibly more obfuscated?

    What’s the point of obfuscating?

    2. Pro for message in requested page : less requests on the HTTP server?

    Nearly all your traffic will be used by serving content that isn’t access denied pages. So I don’t really think that’s a reason to decide for the one or the other. It’s not like users will be F5-hammering on sites they can’t access anyway.

    EDIT:
    To summuarize: It doesn’t really make a difference, but if you can try not to redirect and make sure that the proper headers are sent.

    EDIT2:
    As James Wheare pointed out in the comments it’s against the HTTP spec to redirect to an error page.
    In other words: Do not redirect, but print the error directly on the page where it occured along with the proper headers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to know the best practice about raising an exception without arguments.
I would like to know witch is the best practice to test if void
I would like to know what is the best practice on separating the content
I would like to know the best practice to deploy a website. What I
I would like to know what are the best practice programming tasks in relation
I would like to know what is the best practice in designing the constructors
I would like to know what would be the best practice. I have been
I would like to know what's the best practice for setting up the distribution
I'm starting to learn Android and i would like know the best practice to
I would like to know what the best practice for populating a business object

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.