Forum Sondria46®   →   Sondria46_Blog   →   Blog_Articles   →   How to protect a specific URL ?

How to protect a specific URL ?

Started by admin Nov 06th, 2024 at 10:12
admin
Admin
Posts: 95
Nov 06th, 2024 at 10:12

# Do the regex check against the URI here, if match, set the "require_auth" var
SetEnvIf Request_URI ^/pretty/url require_auth=true


# Auth stuff
AuthUserFile /var/www/htpasswd
AuthName "Password Protected"
AuthType Basic


# Setup a deny/allow
Order Deny,Allow


# Deny from everyone
Deny from all

# except if either of these are satisfied
Satisfy any


# 1. a valid authenticated user
Require valid-user

# or 2. the "require_auth" var is NOT set
Allow from env=!require_auth

 

This article's original url :

https://stackoverflow.com/questions/14603568/password-protect-a-specific-url

 

 

« Last Edit: Nov 06th, 2024 at 10:14 by admin »


Home   •   FAQ   •   Support   •   Terms of Service   •   Privacy   •   News   •   Forum
Copyright © 2024 Sondria46®. All Rights Reserved.
Powered by EvolutionScript Version 6.6