Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

197
Views
Securing a folder and redirecting it to HTTPS

Trying to secure a folder with .htaccess First I want all requests to that folder to redirect to https then to ask the user for a password.

My .htaccess file that's in the root of the protected folder looks like this

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

AuthUserFile "/etc/somewhere/.htpasswd"
AuthType Basic
AuthName "Protected"
require valid-user

I get asked for a password - but the https redirection does not work So if I try www.domain.com/folder the auth box comes up with user/pass request but it stays in http... I want it to first go into https mode then ask for a password.

Ay reason why this is not working ?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!