in reply to Re^3: [OT] Need help in redirecting WebPage in FastCGI-Perl Application via .htaccess
in thread [OT] Need help in redirecting WebPage in FastCGI-Perl Application via .htaccess

So, it means first redirection after login can't be achieved with .htaccess? Why i am asking because i have never used this concept before and thus don't have much experience with apache configurations. In my tool, CGISESSID cookie is being used. I tried adding "domain" in this but it din't work and i am also not sure how will it work. Can you please help me with other suggestions which i can implement?

my $cookie = CGI::Cookie->new( -name => 'CGISESSID', -value => $self->session->id(), #-domain => 'http://9.111.111.111/tools/id/gel444/controller? +action=homeacceptableuse', -secure => 1, -HttpOnly => 1 );
  • Comment on Re^4: [OT] Need help in redirecting WebPage in FastCGI-Perl Application via .htaccess
  • Download Code

Replies are listed 'Best First'.
Re^5: [OT] Need help in redirecting WebPage in FastCGI-Perl Application via .htaccess
by hippo (Archbishop) on Nov 26, 2019 at 22:15 UTC
    I tried adding "domain" in this but it din't work

    http://9.111.111.111/tools/id/gel444/controller?action=homeacceptableuse is not a domain so it's not surprising that it doesn't work. Another problem is that you've specified -secure => 1 when the URL in question is clearly not secure.

    Can you please help me with other suggestions which i can implement?

    One typical approach to achieve your desired feature is:

    1. Any client without the cookie is redirected to the page.
    2. The page requires auth.
    3. The page then sets the cookie so the client won't be sent back to it during the same session.

    You can work on implementing each of these independently until you have the full working solution.

      I understood and totally agree with your point. But the issue is My application is built in a different way as in it supports basic authentication mechanism which is managed at server's end. So whatever the URL we give in address bar, it redirects to that page only after logging in. The login source code is not in scope of my tool. Its is simply managed by .htaccess I have tried writing certain RewriteRule but i could not able to implement. Also, tried  <meta http-eqqiv=refresh content=X url=xxx> This works but with drawbacks as it refreshes again and again. Not able to find any other way till now!