[Web4lib] 301 Redirects question

McMorris,Don dmcmorris at sals.edu
Mon Oct 17 05:28:33 EDT 2005


I have never done this, but in theory it should work.
 
I would think that you could create 1 dynamic page and a DB table. 
 
The 1 page would then be copied to the old file locations.  Of course, this would mean 1000 extra files hanging around, but I would hope it would lessen the load on the Apache server (you wouldn't have the 1000 extra entries in the apache conf, effectively a flatfile database of apache's settings).
 
The page would simply look at its own location (IE: the URL), and use this to query the DB table.  The query will return theURL, atwhichtime the dynamic page will create the 301 Moved header and pass it on to the browser.  
 
If the language you use to create the page is unable to directly make the headers, it could simply use the META Refresh command (<META HTTP-EQUIV="Refresh" content="0;URL=$NewURL">).  Of course, the page could use some text saying "The page you are trying to access has been moved to <a href...>here</a>".  This way, if redirects are off in the browser, they have the link.
 
The only other option I can think of is perhaps something in .htaccess files... Perhaps you can do something there.
 
--Don
 
------------------------ 
"Proudly serving the 964 residents of the Village of Salem, NY" 
Donald J McMorris Jr. 
Assistant Librarian 
Bancroft Public Library 
181 South Main St 
PO Box 515 
Salem, NY 12865 
Phone/Fax: (518) 854-7463 
www.slibrary.org 
XIZ / SALS-SLM 
www.slibrary.org/staff/don.mcmorris/blog/

________________________________

From: web4lib-bounces at webjunction.org on behalf of Bill Erickson
Sent: Wed 10/12/2005 4:42 PM
To: Vishwam Annam
Cc: WEB4LIB
Subject: Re: [Web4lib] 301 Redirects question



If you can define the pages you want to redirect in the form of regular
expressions, the Apache RedirectMatch directive might be the thing you need.

http://httpd.apache.org/docs/2.0/mod/mod_alias.html#redirectmatch

On 10/12/05, Vishwam Annam <vishwam.annam at wright.edu> wrote:
>
> Dear Web4 Lib members,
>
> We use 301 redirects to redirect an old webpage to the new one. We had
> static html pages for our databases, and recently made all of them
> database driven. Due to this, I ended up having around 1,000 or so..
> changed URLs, which needed redirects. If I add all these 1,000 to the
> httd.config file, then the file size gets huge and it can significatly
> impacts the server load.
>
> I was wondering, has any one across the similar problem, if so how you
> hndled this? I am sure, we could create "page moved" pages for these
> links, but that can be tediuous work.
>
> Thanks for any assitance,
>
> Vishwam
>
> Vishwam Annam
> Web Developer
> 120 Paul Laurence Dunbar Library
> 3640 Colonel Glenn Hwy.
> Dayton, Oh 45435
> Office: 937-775-3262
> FAX 937-775-2356
> _______________________________________________
> Web4lib mailing list
> Web4lib at webjunction.org
> http://lists.webjunction.org/web4lib/
>



--
Bill Erickson
PINES Systems Developer
Georgia Public Library Service
billserickson at gmail.com
http://open-ils.org
_______________________________________________
Web4lib mailing list
Web4lib at webjunction.org
http://lists.webjunction.org/web4lib/




More information about the Web4lib mailing list