Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a landing page that redirects if the http referer is from a known site using a simple nginx rule:

location = /index.html {
  if ($http_referer ~* (www.)?amazon.com) {
    return 302 https://mydomain.com/amazon.html;
  }
}

Should the redirect use a 301 (permanent) or 302 (temporary)? I'm thinking 302, since this is a marketing tactic. What is the best for SEO?

Thanks.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

302 redirects should be used if they are temporary only - it basically serves as an instruction to "recrawl this later", as far as my understanding goes. So if the redirect will be permanently in place, 301 is the way to go.

However given you're testing a referrer, when Google crawls the site they won't know about the redirect at all, so I'm not sure what bearing you'll see this having on your SEO.

share|improve this answer
    
Agree about no bearing on SEO, but just want to do what is best for browser clients. –  Justin Jun 5 at 23:25
    
301 is best, that way they'll cache the redirect, and save you a request. Not super expensive, but if it's permanent you may as well. If you'll only have the redirect in place for a short time, 302 will help to prevent the caching. –  LuckySpoon Jun 5 at 23:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.