<p>I'm building a RESTful web service which has multiple URIs for one of its resources, because there is more than one unique identifier. Should the server respond to a GET request for an alternate URI by returning the resource, or should I send an HTTP 3xx redirect to the canonical URI? Is <em>HTTP 303 (see also)</em> the most appropriate redirect?</p>

<p>Clarification: the HTTP specification makes it clear that the choice of redirect depends on which URI future requests should use. In my application, the 'canonical' URI is the most stable of the alternatives; an alternative URI will always direct to same canonical URI, or become invalid.</p>

[{'answer_id': 31825, 'author': 'Ubiguchi', 'author_id': 2562, 'author_profile': 'https://Stackoverflow.com/users/2562', 'pm_score': 3, 'selected': True, 'text': '<p>I\'d personally plump for returning the resource rather than faffing with a redirect, although I suspect that\'s only because my subcoscious is telling me redirects are slower.</p>\n\n<p>However, if you were to decide to use a redirect I\'d think a 302 or 307 might be more appropiate than a 303, although the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" rel="nofollow noreferrer">w3.org</a> has details of the different redirect codes you could use.</p>\n'}, {'answer_id': 31846, 'author': 'Nicholas', 'author_id': 2658, 'author_profile': 'https://Stackoverflow.com/users/2658', 'pm_score': 2, 'selected': False, 'text': '<p>Under W3C\'s <a href="http://www.w3.org/TR/webarch/" rel="nofollow noreferrer">Architexture of the World Wide Web, Volume One</a>, there is a section on URI aliases (<a href="http://www.w3.org/TR/webarch/#uri-aliases" rel="nofollow noreferrer">Section 2.3.1</a>) which states the following:</p>\n\n<p>"When a URI alias does become common currency, the URI owner should use protocol techniques such as server-side redirects to relate the two resources. The community benefits when the URI owner supports redirection of an aliased URI to the corresponding "official" URI. For more information on redirection, see section 10.3, Redirection, in <a href="http://www.w3.org/TR/webarch/#RFC2616" rel="nofollow noreferrer">RFC2616</a>. See also <a href="http://www.w3.org/TR/webarch/#CHIPS" rel="nofollow noreferrer">CHIPS</a> for a discussion of some best practices for server administrators."</p>\n\n<p>For what it\'s worth, I would recommend a 302 redirect.</p>\n'}, {'answer_id': 32258, 'author': 'Peter Hilton', 'author_id': 2670, 'author_profile': 'https://Stackoverflow.com/users/2670', 'pm_score': 1, 'selected': False, 'text': "<p>The answer from Ubiguchi had what I needed, except that I now think a redirect is the way to go, via the link to the HTTP 1.1 specifiction section on response codes. It turns out that I actually need a 301 redirect because the URI I'm redirecting to is more 'correct' and stable, and should therefore be used for future requests.</p>\n"}]
['https://Stackoverflow.com/questions/31800', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2670/']