Msg#: 4425699 posted 7:59 pm on Mar 6, 2012 (gmt 0)
we are phasing out a section of our site that has around 1500 pages. our plan is to 301 redirect all articles older than jan. 1, 2012 (around 1400 pages). all articles are database driven and have a numerical id associated with them.
is it possible to set up a htaccess conditional to 301 redirect pages older than 1/1/12 (or based on ID as the ID increases with each article)?
if i simply remove the pages, we'll have 1400 new 404 errors, which is definitely not ideal.
Msg#: 4425699 posted 9:18 pm on Mar 6, 2012 (gmt 0)
You could alter the PHP script running the site to generate the 301 header based on date offset. This would require little future maintenance.
You could add a set of htaccess rules to do this, but they would need manually updating on a regular basis. You'd need to be very careful with the RegEx patterns to ensure you didn't redirect requests that shouldn't be redirected.
Where would you redirect those users to? It would be bad form to funnel a large number of page redirects to a category index page. They should each be redirected to a page with related or similar content on. If the old page has truly "Gone", you should return the "410 Gone" status code instead.
Msg#: 4425699 posted 3:15 am on Mar 7, 2012 (gmt 0)
or based on ID as the ID increases with each article
D'you mean that the age of the article is implicit in the URL? Or at least in the query string? That would save a whole lot of trouble. No messy detours to php scripts ;)
Ditto to the above question, though: Where is everyone being redirected to? The words "phasing out" imply that part of the site simply won't be there any more, in which case a 410 is the appropriate response.
If you don't already have a custom 410 page, this is the time to make one. (Do not repeat do not use the Apache 410 default. It's even scarier than the 404 default.) Give as much information as you like, and make the page as pretty as you like. The important thing is that the original request returns a 410 if that's what is really happening.
Msg#: 4425699 posted 5:28 pm on Mar 7, 2012 (gmt 0)
thank you both for your help! our seo company had recommended 301-ing any page with inbound links to root to preserve link juice. this would be about 250 pages. the remaining pages i would create a custom 410 page.
do you think 250 pages redirected to root is too much?
Msg#: 4425699 posted 11:44 pm on Mar 7, 2012 (gmt 0)
our seo company had recommended 301-ing any page with inbound links to root to preserve link juice
If the people at the other end of the link had wanted to link to the front page, they would have done so. And I really doubt a redirect will fool g###.
How many links are we talking about? Are they in steady use? (I would hope not, or you wouldn't be talking about dumping the pages.) Is it practicable to contact them all and say that the page no longer exists? Outdated links don't do either side-- or, ahem, their human users-- any good.