guardian/frontend — pull request #2953 by commuterjoy (2014-01-30 17:37:07+00:00)
Title: WIP - example of handling R1 routing, redirects etc. in scala

@gklopper This is what I had in mind from that earlier email. I'm imaging this as a sort of catch all at the end of our NGW routes in nginx.

----

**Case 1** - A request for a resource with a known redirect in place,

```
curl -i http://society.localhost:9000/health/news/0,,1937607,00.html
```

Yields, `301` and takes the user to the correct destination.

We need to keep an index of redirects somewhere (Eg, in resources). Ultimately this gets replaced by the Content API redirection index at some point in the future.

**Case 2** - A request for a resource that is archived,

```
curl -i http://society.localhost:9000/societyguardian/index/0,,1876185,00.html
```

Yields, `200` and the contents of the s3 resource.

**Case 3** - A request for a resource we've don't know about,

```
curl -i http://society.localhost:9000/not-here/index/0,,1876185,00.html
```

Yields, `404`.

All of this means there's one place to look for redirects, archived files. Which is in improvement on today.