开发者

When creating a short url service, is 302 temporary redirect the best way to go?

开发者 https://www.devze.com 2023-03-10 06:20 出处:网络
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

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: exa开发者_开发技巧mple.com/g/{base64id}

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


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)


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消