We are developing an email sending application ( la Mailchimp). Hyperlinks inserted by our users, in the emails they want to send, are replaced by a tracking URL on our application (https://ourdomain.com/trackingurl?blablabla) which then redirects the email reader to the original URL our users included in their emails. This allows us to record statistics about link clicks.Until now, we used 301 for those redirections, but we noticed that Google began indexing pages on our application which are in fact redirects to other domains. (The title and snippet in Google results are from the other domain, but the link in green is from our application). We took action by adding those urls to our robots.txt, but Google seems to take forever (months!) before removing them for its index and removing them by hand in Webmaster Tools would take a lot of time since there are lot.I would like to know which kind of HTTP redirect (301 or 302) is best suited for this kind of opreation ? Do you think switching to 302 redirects could improve this situation since we don't really want Google to index redirected links from our clients emails ?
What kind of redirect (301 or 302) for an email links tracker?
seo;redirects;email;links;robots.txt
I actually ended up adding X-Robots-Tag: noindex, nofollow in my HTTP headers (plus the 301 redirects) which seems to clear up the issue of the redirects being indexed by Google. Stephen your answer is correct when in comes to which kind of redirect to use, but to clear up the issue of the links being indexed, this solution is what I was searching for.