[lug] apache

rm at mamma.varadinet.de rm at mamma.varadinet.de
Wed Jan 31 05:23:57 MST 2001


On Tue, Jan 30, 2001 at 03:11:31PM -0700, D. Stimits wrote:
> Hugh Brown wrote:
> > 
> > I am trying to setup a page that requires authorization to access, but
> > based on who the user is, I'd like it to redirect to a page specific to
> > the user.  Is it possible to do this with apache and if not, how would
> > you all do it.
> > 
[prblem desc..]

> Have the submit of client name run a cgi script rather than html page;
> put a MySQL or other SQL interface into the cgi script (I'd use C++ for
> it, but there are a lot of people who would cringe and instead use PHP,
> Python, or Perl for that). Ignore actually forwarding them to the
> individual directories per se, create all output by the cgi copying html
> files or templates out of the client directory (you'll probably write a
> cookie to identify the session). Alternatively, if they have javascript
> enabled (I hate javascript, all the browsers have some feature that
> behaves differently than other browsers, and ten times as many features
> that are outright broken), have the cgi send a normal javascript
> redirect (the redirect link could be listed in the SQL). There are
> actually a lot of creative ways to do this with cgi and/or javascript,
> but most of the sane/flexible (try not to laugh too hard) ones involve
> SQL.

While this is possible it seems like an awfull big solution for this
problem (and, depending on the volumn of the site, this does produce
quite a bit of overhead). Why not just use Apaches mod_rewrite? As
long as the location is password protected you can use the REMOTE_USER
information. An excellent introduction to mod_rewrite can be found at:

 http://www.engelschall.com/pw/apache/rewriteguide/ 

Hope this helps


  Ralf



More information about the LUG mailing list