homepage Welcome to WebmasterWorld Guest from 54.204.249.184
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Logic for 301 Redirect
Phasing out a section of our site, how to 301 redirect majority of pages?
suga




msg:4425701
 7:59 pm on Mar 6, 2012 (gmt 0)

hello,

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.

thanks!

 

g1smd




msg:4425711
 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.

lucy24




msg:4425799
 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.

suga




msg:4426118
 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?

g1smd




msg:4426171
 8:01 pm on Mar 7, 2012 (gmt 0)

Yes, way too much. My limit is zero.

lucy24




msg:4426248
 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.

g1smd




msg:4426252
 12:09 am on Mar 8, 2012 (gmt 0)

And I really doubt a redirect will fool g

The site would likely be quickly flagged for having "soft 404 errors".

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved