portalzine

portalzine / Alternative to Basic Auth

Last active 13 hours ago

Like 0

Simple .htaccess Alternative to Basic Auth

Revision c34ac7f5da981470374960f27e1f9605d10904fa

basic_auth_alternative.txt Raw
1RewriteEngine On
2
3RewriteCond %{QUERY_STRING} !^access_key=my-password$ [NC]
4RewriteCond %{HTTP_COOKIE} !access_key=my-password
5RewriteRule ^ - [R=511,L]
6
7Header set Set-Cookie "access_key=my-password; path=/; Max-Age=3600; HttpOnly; Secure; SameSite=Strict"