Apache redirect

Jason Clinton clintonj at umkc.edu
Tue Aug 27 14:16:04 CDT 2002


>
>
>Honestly, I don't see any reason in this case (same box, etc.) why a
>redirect needs to be done for a significant length of time in the first
>place... get the new site done, and put it right where the old one was.
>Problem Solved.
>
>Dustin
>
Take this site I created for instance: http://www.alianzas.us

Site has one 'main' page and three 'sub region' pages. In order to use
the same templates and include files across the entire site, each
section must reside in a subdirectory. Thus, the page I need people to
see at http://www.alianzas.us is actually
http://www.alianzas.us/main/index.shtml . So, I have a permananet
redirect in my Apache config and the user never even notices they were
redirected.... And their back button still works. :)

Actually, if you planning a very large site, you almost never want to
have your openning pages reside in the root dir. Better to set up a
structure like this:

/[redirect to home]
/shared/
/images/
/media/
/home/
/section1/
/section2/
/section3/

That way you can use server side includes (SSI) that use relative URLs
such as in my index.shtml files: <!--#include
virtual="../shared/header.shtml"--> ... you get the idea...

So then all I have to do to create a new section is copy the /home/ dir
over to a new dir and fill in the blanks.

This method is also wonderful for maintaining CSS. It allows you to do
site wide style changes really quickly armed with only a text editor.





More information about the Kclug mailing list