Redirect incoming URL request between basic authentication and openidc. I want to categorize if the request for URL is coming from "wget/curl" then i need it to get authenticated with Basic authentication and if the user input is from browser then i need to re-direct for openidc.
New to Apache and learning, tried the below and stuck creating a Rewriterule
ServerName www.domain.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/Domain
<if %{QUERY_STRING} = 'wget'>
<Directory /var/www/wget-curl>
RewriteEngine On
RewriteCond "%{QUERY_STRING}" "wget"
Rewriterule
AuthType Basic
AuthName " Wiki Basic Credentials"
AuthBasicProvider file
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Directory>
</if>
<Else "%{HTTPS} == 'on'">
<Directory /var/www/openidc>
Options +FollowSymLinks +Indexes
IndexOptions FancyIndexing HTMLTable
AuthType openid-connect
Require valid-user
AllowOverride all
</Directory>
</Else>