httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Wort <...@pobox.com>
Subject RE: [users@httpd] problem configuring mod_rewrite rule
Date Wed, 05 Mar 2003 17:14:09 GMT



I can think of a lot of reason you might not want to do this but...

Because each user needs to authenticate anyway, why not use a form for the
initial page with a entry box (or pull down menu) for the user name and
use seperate .htaccess files in each home directory?

Each use would then have seperate passwords, it would not be to difficult
to use SSL for the authentication portion to protect the password and you
would not have to depend on REMOTE_USER.

Just a suggestion.





On Wed, 5 Mar 2003, Michael Klama wrote:

> Joshua,
> The URL does or does not have to change.  I was trying to change the level
> of the doc root using the REMOTE_USER condition.  The doc root would have to
> change from /home/users/web/ to /home/users/web/*usersdir*/ which would be
> based on the remote users name that they log in as.  I had already looked at
> the %{LA-U:variable} and since I am doing this in an htaccess file within
> the /home/users/web/ directory did not feel based on the instructions that
> it was necessary to do this in the serverwide context.  The instructions
> state that if I am doing the rewrite in the directory level that I can use
> REMOTE_USER at that level because the authentication occurs in the first
> phase and the rewrite occurs in the fixup phase.  I have the authentication
> directive in the VH entry in the httpd.conf file.
>
> Mike
>
> -----Original Message-----
> From: Joshua Slive [mailto:joshua@slive.ca]
> Sent: Wednesday, March 05, 2003 11:12 AM
> To: users@httpd.apache.org
> Subject: RE: [users@httpd] problem configuring mod_rewrite rule
>
>
> On Wed, 5 Mar 2003, Michael Klama wrote:
>
> > Owen,
> > You are correct in my misunderstanding of what mod_rewrite is capable of
> > doing.  What I was trying to do was change the doc root based on the login
> > info.  Sorry if I took up your valuable time trying to do something that
> is
> > not possible.  I will try your suggestion regarding creating a separate VH
> > for each user for the redirection I am looking for.  Thank you for all of
> > your time and help.  I will post with the result so others may use this
> > solution in a similar situation.
> >
> > -----Original Message-----
> > From: Boyle Owen [mailto:Owen.Boyle@swx.com]
>
> > If so, you have a major misunderstanding of mod_rewrite. It rewrites
> URLs -
> > not filepaths. It turns one URL into another URL so the final destination
> > still has to be a URL. But you want to change an internal filepath and
> that
> > is not within the scope of mod_rewrite.
>
> I haven't been following this thread, so I may be mistaken about the
> context, but I don't believe this is correct.
>
> To put it in Apache terms, mod_rewrite can act either like a Redirect or
> an Alias.  Using the [R] flag or supplying an absolute URL causes
> mod_rewrite to send a redirect.  Using just a file-system or url-path
> causes mod_rewrite to simply deliver the content without redirecting.  In
> other words, mod_rewrite can transparently change the content delivered by
> a URL without actually changing the URL in the browser.
>
> If my very quick skimming of the thread is correct, then the original
> poster's problem is likely that %{REMOTE_USER} is not available in the
> server-wide context, because this context is evaluated before the user
> authentication is complete.  But there is a way around this: use
> %{LA-U:REMOTE_USER} to ask mod_rewrite to perform a "look-ahead" to find
> out what the REMOTE_USER will be once auth is complete.
>
> See the mod_rewrite docs for details:
> http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html#rewritecond
> (special note 4).
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
=        Inkling Research Inc.      =
=    Tim.Wort@InklingResearch.com   =
=        Tim.Wort@pobox.com         =
=                                   =
=        Eschew Obfuscation         =
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message