Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 577737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:11:08+00:00 2026-05-13T14:11:08+00:00

I have a domain, mattpotts.com and have set up a sub-domain dev.mattpotts.com for me

  • 0

I have a domain, mattpotts.com and have set up a sub-domain dev.mattpotts.com for me to develop on and will then copy the files to the normal domain when they’re ready to go.

My directory structure is as follows and dev.mattpotts.com points to dev/

+-public_html/
  +-project1/
  +-project2/
  +-project3/
  +-dev/
    +-project1
    +-project2
    +-project3

I basically want to be able to go from http://mattpotts.com/project1 to https://dev.mattpotts.com/project1 by adding dev..

I have the following .htaccess in dev/ and it works, all this needs to do is force https.

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteCond %{REQUEST_URI} dev 
RewriteRule ^(.*)$ https://dev.mattpotts.com$1 [R,L]

I want to force https so that I can securely use http auth on the directory. However, when I combine it with the following rules, it doesn’t work. I have my .htpasswd set up but I’ve not even had the login form show up yet.

AuthType Basic
AuthName "Dev Protected Area"
AuthUserFile .htpasswd
Require valid-user

How can I successfully combine the to set of .htaccess rules?

Edit, very strange things are happening!

https://dev.mattpotts.com/project1/ displays ‘hello!’ from non dev version of site (note https)
http://dev.mattpotts.com/project1/ displays ‘hello dev!’ (as desired) from dev version. What’s going on here?!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T14:11:09+00:00Added an answer on May 13, 2026 at 2:11 pm

    You’ve told us where your .htaccess file is, but you haven’t told us where your .htpasswd file is. According to the Apache documentation on AuthUserFile:

    Syntax: AuthUserFile file-path

    File-path is the path to the user
    file. If it is not absolute (i.e., if
    it doesn’t begin with a slash), it is
    treated as relative to the ServerRoot.

    So in other words, it is looking for the .htpasswd in somewhere like /etc/apache2/.htpasswd. So either move your .htpasswd file there, or make your directive contain an absolute path to the file, e.g.:

    AuthType     Basic
    AuthName     "Dev Protected Area"
    AuthUserFile /home/mattpots.com/public_html/dev/.htpasswd
    Require      valid-user
    

    However, for security reasons, I highly recommend keeping your .htpasswd file outside of your document root.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have domain site.com and there is subdomain sub.site.com Once you open sub.site.com you
If I have domain name example.com , and if I set an A record
I have a domain set up: www.domain.com, that runs a codeigniter website. I want
i have a domain full-ops.com that i transferred to another host, but it takes
I have a domain foo.com on server bar. I have a subdomain api.foo.com which
I'm have domain class with property that represents files uploaded on my GSP. I've
I would like to have domain.com using asp.net mvc2 technology and domain.com/blog would use
I have a.domain.com and b.domain.com , and would like to allow these to call
I have a domain name www.xyz.com and I want to make sure if someone
I have a domain test.com and I want this domain to redirect to mydomain.com/test.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.