Is it considered bad practice for a canonical link on a page return a 302 redirect to a login page?


If https://foo.com/bar/slug?version=2019-02-01&signature=XXX returns

HTTP/1.1 200 OK

<!DOCTYPE html>
  <link rel="canonical" href="https://foo.com/bar/slug" />

but https://foo.com/bar/slug returns

HTTP/1.1 302 Found
Location: https://foo.com/login?ReturnUrl=%2Fbar%2Fslug

A) Is this considered bad practice?

B) If the url with the querystring returns the 200 will it's content still be indexed if a search engine crawls it?

c) If a search engine crawls multiple variants of the querystring version (/bar/slug?version=2019-02-01&signature=XXX, /bar/slug?version=2019-02-02&signature=YYY, /bar/slug?version=2019-02-03&signature=ZZZ) will search engines only "keep" the most recent version (assuming I set Last-Modified headers to match the date in the querystring version and they all have the same canonical link) indexed?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.