what type of redirect to a connection page should I use?

- 1 answer

Ad

What type of redirect should I be using to redirect a user to a connection page if he needs to be authenticated before using one service of my website ?

Just to be sure using the right numbers for the crawler's to witness what a good student I am !

Ad

Answer

Ad

Available redirection statuses:

301 Moved Permanently

The 301 (Moved Permanently) status code indicates that the target resource has been assigned a new permanent URI.

302 Found

The 302 (Found) status code indicates that the target resource resides temporarily under a different URI.

303 See Other

The 303 (See Other) status code indicates that the server is redirecting the user agent to a different resource.

304 Not Modified

There is no need for the server to transfer a representation of the target resource because the request indicates that the client already has a valid representation.

307 Temporary Redirect

This status code is similar to 302 (Found), except that it does not allow changing the request method from POST to GET.

308 Permanent Redirect

This status code is similar to 301 (Moved Permanently), except that it does not allow changing the request method from POST to GET.

Statuses 305 Use Proxy and 306 (Unused) are respectively deprecated and no longer used.

So by default, I would choose the 303 See Other, since it's the one that suits your needs the best.

Ad
source: stackoverflow.com
Ad