Redirect incoming URL request between basic authentication and OpenIDC. I want to categorize if the request for URL is coming from Wget or 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>