Project

General

Profile

Re-Direct to index page after login

Added by Dan over 7 years ago

Hello,

I am using auth.backend = "htdigest". Normally when the IP of my web server is hit the user gets the index.html page after log in (http://10.10.10.10). While being logged in if they navigate to a different page (ie: http://10.10.10.10/somepage.html?some=variables) and then close/reopen the web browser, the web browser remembers the last place they were and when the user re-login again the browser opens http:10.10.10.10/somepage.html?some=variables. Is there a way lighttpd can force them to go back to index.html on login?

To simplify, lighttpd will redirect to index.html on successful login regardless of the browser url without using session cookies etc.

I did some searching for the answer but cannot find a solution.

Thank you,
Dan Pattison


Replies (3)

RE: Re-Direct to index page after login - Added by gstrauss over 7 years ago

I did some searching for the answer but cannot find a solution.

I don't think you are searching very well. There are numerous ways for a backend CGI script (e.g. PHP) to influence a client browser, but the web server (lighttpd) is not directly involved.

Try using a session cookie, and if the cookie expires or is not present when the client browser connects, then have your CGI script redirect to index.html. You could do this by writing a custom fastcgi auth script or you could use mod_magnet with some custom lua code, but a fastcgi auth script seems most appropriate to what you have described.

RE: Re-Direct to index page after login - Added by Dan over 7 years ago

Hello,

Thanks for the reply. I think I am searching just fine. I was searching to see if there was a way for lighttpd to do a re-direct to a certain page after a successful login like I mentioned above. It seems that it does not have a provision for this. I was wanting to avoid using a separate php login page with session cookies. I will admit that I am not fully understanding all the magic lighttpd does to authenticate a web login, so my question may have seemed stoned, my apologies.

Thank you,
Dan Pattison

RE: Re-Direct to index page after login - Added by gstrauss over 7 years ago

I will admit that I am not fully understanding all the magic lighttpd does to authenticate a web login

The htdigest authentication you are using is simple challenge/response, and implemented by more than a few web servers, including lighttpd
https://tools.ietf.org/html/rfc7616 HTTP Digest Access Authentication

    (1-3/3)