7

When creating a short URL service for URLs on the same domain, should we be using a 302 redirect?

Full URL structure: example.com/gig/{id}/gig-full-name-slug
Short URL structure: example.com/g/{base64id}

We're using asp.net mvc3, if there's any shortcuts.

CloudyMarble
  • 36,908
  • 70
  • 97
  • 130
Ben Cull
  • 9,434
  • 7
  • 43
  • 38

2 Answers2

7

Your best bet is to return a 301 so that search engines pick it up as a proper redirect and dont try to index your short urls. This is what the others do (ie. bit.ly)

dkarzon
  • 7,868
  • 9
  • 48
  • 61
3

As it's not a temporary redirect (as the content will never be back at that URL), a HTTP 303 See Other redirect would be more appropriate.

Guffa
  • 687,336
  • 108
  • 737
  • 1,005
  • 2
    I suspect that other short URL services are using HTTP 301 Moved Permanently. Probably because that response is cachable. – goalie7960 Jun 03 '11 at 00:11
  • @goalie looks like you're right. I'll probably roll with the 301. Cheers. – Ben Cull Jun 03 '11 at 01:35
  • @Ben Cull: Well, a 301 doesn't really fit, but I suppose that you have to adapt to how others (mis)use the codes rather than what the standards say... – Guffa Jun 03 '11 at 09:21