Redirect/Rewrite after basic authentication

303 Views Asked by At

First sorry for my bad English.

So I have an Openhab system on my raspberry PI with Apache. I have A basic authentication with two groups Admin and Users and I want to redirect Users the open the Landing page to redirect after Loggin with the Basic auth to the UI page. The problem is I can't use a PHP script.

So I tried to redirect the Users with the .htaccess

.htaccess:

<Location />
RewriteEngine ON
RewriteCond %{REMOTE_USER} =Elias
RewriteRule ^start/index /basicui/app
</Location>

But so it doesn't work and I haven't found anything that I help with this problem

1

There are 1 best solutions below

0
Tyr On BEST ANSWER

I got the Solution

 RewriteCond %{REQUEST_URI} ^\/start\/index$
        RewriteCond %{REMOTE_USER} =Username
        RewriteRule .* http://openhab.clubdrei.com/basicui/app [R=302,L]
        RewriteCond %{REMOTE_USER} =Username
        RewriteRule .* http://openhab.clubdrei.com/basicui/app [R=302,L]