V
V
Victor Golovko2019-03-06 14:15:41
htaccess
Victor Golovko, 2019-03-06 14:15:41

How to make http authorization for a specific url (.htaccess)?

Whether it is possible to make by means of .htaccess http authorization for a certain url.
Not a folder or file to close, but a url. Those. we want to make such authorization for one page of the site.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dodo512, 2019-03-06
@dodo512

SetEnvIf Request_URI ^/page$ blocked
Deny from env=blocked
Satisfy any

AuthType Basic
AuthName "Пожалуйста, авторизуйтесь"
AuthUserFile полный/путь/на_сервере/.htpasswd
Require valid-user

A
Alexander, 2022-02-14
@alexTitakoff

https://dzen-code.ru/http-auth-through-htaccess-url/
slightly added
thanks to dodo512

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question