Mobile app version of vmapp.org
Login or Join
Tiffany637

: 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

@Tiffany637

Posted in: #301Redirect #302Redirect #403Forbidden

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.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Tiffany637

1 Comments

Sorted by latest first Latest Oldest Best

 

@Smith883

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme