You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ajay Garg <aj...@gmail.com> on 2013/08/24 20:11:51 UTC

[users@httpd] Re: Queries regarding the feasibility of achieving a use-case with HTTPD

Hi all.

I could accomplish the first-part, using the "Redirect" directive in
"/etc/httpd/conf/httpd.conf" as follows ::

#########################################################################
         Redirect permanent /alias1
http://www.servername.com/login/login.php
         Redirect permanent /alias2
http://www.servername.com/login/login.php
         Redirect permanent /alias3
http://www.servername.com/login/login.php
         ...
         ...
         Redirect permanent /aliasn
http://www.servername.com/login/login.php
#########################################################################



Thus, I will be grateful if someone could lend me a "trick", to have
available the "original URL address" available in login.php, so that I can
redirect to this "original URL address" after doing the authentication
stuff.

For example, using the above "first part solution", if a user enters a URL
of type http://www.servername.com/alias2/deep/internal/url, then he will be
nicely redirected (the first time) automatically to
http://www.servername.com/login/login.php.  Thereafter, we NEED the
original-url (http://www.servername.com/alias2/deep/internal/url) in
login.php, so that the user may finally be redirected (the second time)
automatically to the desired URL, after the authentication-stuff is done.


Looking forward to a reply, for the "second part of the mystery" :)



On Sat, Aug 24, 2013 at 4:44 PM, Ajay Garg <aj...@gmail.com> wrote:

> Hi all.
>
> Let me first present the use-case :)
>
>
>
> === USE-CASE BEGIN ===
>
> I have a number of <Directory></Directory> directives (via the .conf
> files), and each director has an alias for it.
> So, my server can present different stuff, in accordance with the URLS
> like ::
>
>                 http://127.0.0.1/alias1
>                 http://127.0.0.1/alias2
>                 ...
>                 ...
>                 http://127.0.0.1/aliasn
>
>
> Now, I desire to add authentication, whenever any user visits any of these
> directories/aliases/links, or any directories/aliases/llinks in their
> sub-domains.
>
>
> Thus, the ideal workflow desired is ::
>
>               a)
>               User enters in the browser, a URL like "
> http://127.0.0.1/alias1//deep/internal/url"
>
>               b)
>               He is AUTOMATICALLY re-directed to a login page, say "
> http://127.0.0.1/login.php"
>
>               c)
>               User enters the credentials, and presses the "login" button
> in login.php.
>
>               d)
>               User is then AUTOMATICALLY taken to "
> http://127.0.0.0.1/alias1/deep/internal/url"
>
>               e)
>               Thereafter, whenever the user enters into ANY URL (i.e. any
> directory/alias, and not just "alias1"), he should be taken directly to the
> url
>               (withot requiring to enter the credentials again).
>
>
>
> Thus, my queries are ::
>
> i)
> Is the above workflow possible by merely using HTTPD, or some form of
> external proxy-software (like "squid") is required?
>
> ii)
> If it is indeed possible to achieve the above with just HTTPD, I will be
> grateful if you could let me know how to add redirections, so that
> any URL goes via the "login.php" in-between (of course, if the user has
> already authenticated once, he is taken directly to the URL).
>
>
> Note that I understand that to truly require only one-time authentication,
> I will be required to set up "cookies".
>
> My major query here is, as to how can we setup redirections in HTTPD in
> the way I have described (of course, if it is possible to do so, without
> requiring
> any external proxy-software) :)
>
>
> --
> Regards,
> Ajay
>



-- 
Regards,
Ajay