开发者

Can I protect with a .htaccess file some routes with sinatra?

开发者 https://www.devze.com 2022-12-10 22:34 出处:网络
I开发者_如何学Python wrote a small app with Sinatra and have some admin routes (/admin/new, admin/edit/2, ...) and want to protect them with a .htaccess prompt. Can somebody tell me how I do that?Auth

I开发者_如何学Python wrote a small app with Sinatra and have some admin routes (/admin/new, admin/edit/2, ...) and want to protect them with a .htaccess prompt. Can somebody tell me how I do that?


AuthName "Restricted Area"
AuthType Basic
AuthUserFile /path/to/file/.htpasswd

<Files "protected.html">
Require valid-user
</Files>

If you want to use Sinatra for Authentication, check out this faq.

0

精彩评论

暂无评论...
验证码 换一张
取 消