|
| 1 | +--- |
| 2 | +kind:change |
| 3 | +title:Preview repository redirects |
| 4 | +created_at:2015-04-17 |
| 5 | +author_name:jasonrudolph |
| 6 | +--- |
| 7 | + |
| 8 | +From time to time, repository names change. If you make a GitHub API request using a repository's old name in the URL, the API has historically responded with`404 Not Found`. To help API clients gracefully handle renamed repositories, the API will soon begin[redirecting][redirects] to the repository's new location. |
| 9 | + |
| 10 | +You can preview these redirects now. In the coming weeks, we'll announce the timeline for enabling these redirects for everyone. |
| 11 | + |
| 12 | +##How can I try out the redirects? |
| 13 | + |
| 14 | +Starting today, developers can preview the redirect functionality for relocated repositories. To access this redirect functionality during the preview period, you’ll need to provide the following custom[media type][] in the`Accept` header: |
| 15 | + |
| 16 | +application/vnd.github.quicksilver-preview+json |
| 17 | + |
| 18 | +During the preview period, we may change aspects of the redirect behavior based on developer feedback. If we do, we will announce the changes here on the developer blog, but we will not provide any advance notice. |
| 19 | + |
| 20 | +##When will the redirects occur? |
| 21 | + |
| 22 | +To understand when these redirects would take place, you'll want to understand how to identify a repository's location. Repositories are located using the combination of the owner's name and the repository's name. For example, the[@twbs][] organization owns the popular[bootstrap repository](https://github.com/twbs/bootstrap). We identify this repository as[twbs/bootstrap](https://github.com/twbs/bootstrap). |
| 23 | + |
| 24 | +The repository's location changes in the following scenarios: |
| 25 | + |
| 26 | +- When the owner changes the repository name. |
| 27 | +- When the owner renames their user account or organization account. |
| 28 | +- When the owner transfers the repository to a new owner. |
| 29 | + |
| 30 | +Continuing our[twbs/bootstrap](https://github.com/twbs/bootstrap) example, this repository used to be owned by the[@twitter][] organization, and it was therefore located at[twitter/bootstrap](https://github.com/twitter/bootstrap). With repository redirects, you'll be able to make an API request using the repository's old location and receive[either a`301` or`307` HTTP redirect][redirects], depending on the type of request being made. You can then follow the redirect to the new location. |
| 31 | + |
| 32 | +##Send us your feedback |
| 33 | + |
| 34 | +We hope you'll take these redirects for a spin and[let us know what you think][contact]. Happy redirecting! |
| 35 | + |
| 36 | +[@twbs]:https://github.com/twbs |
| 37 | +[@twitter]:https://github.com/twitter |
| 38 | +[contact]:https://github.com/contact?form%5Bsubject%5D=API+Repository+Redirects |
| 39 | +[media type]:/v3/media/ |
| 40 | +[redirects]:/v3/#http-redirects |