: Which HTTP response status code is most appropriate for a restricted URL? I have a page on my website that's targeted at logged-in users only. Logged-out visitors shouldn't see the content. Imagine
I have a page on my website that's targeted at logged-in users only. Logged-out visitors shouldn't see the content.
Imagine the page URL is example.com/upload/.
In cases when users aren't authenticated (logged-out), would a 301, 302 or 404 response be most appropriate? Please explain why in your answer.
More posts by @Tiffany637
1 Comments
Sorted by latest first Latest Oldest Best
You could use an error 401 = You are not authorised to view this page
However read this: stackoverflow.com/questions/3297048/403-forbidden-vs-401-unauthorized-http-responses
A 301 redirect means that the page has permanently moved to a new location.
A 302 redirect means that the move is only temporary
A 404 redirect means that the page can't be found
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.