Do I need to use http redirect code 302 or 307?
Posted
by Iain Fraser
on Stack Overflow
See other posts from Stack Overflow
or by Iain Fraser
Published on 2010-03-18T05:12:13Z
Indexed on
2010/03/18
5:21 UTC
Read the original article
Hit count: 473
I am working on a CMS that uses a search facility to output a list of content items. You can use this facility as a search engine, but in this instance I am using it to output the current month's Media Releases from an archive of all Media Releases.
The default parameters for these "Data Lists" as they are called, don't allow you to specify "current month" or "current year" for publication date - only "last x days" or "from dateA to dateB". The search facility will accept querystring parameters though, so I intend to code around it like this:
- Page loads
- How many days into the current month are we?
- Do we have a query string that asks for a list including this many days?
- If no, redirect the client back to this page with the appropriate query-string included.
- If yes, allow the CMS to process the query
Now here's the rub. Suppose the spider from your favourite search engine comes along and tries to index your main Media Releases page. If you were to use a 301 redirect to the default query page, the spider would assume the main page was defunct and choose to add the query page to its index instead of the main page.
Now I see that 302 and 307 indicate that a page has been moved temporarily; if I do this, are spiders likely to pop the main page into their index like I want them to?
Thanks very much in advance for your help and advice.
Kind regards
Iain
© Stack Overflow or respective owner