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 7959761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:37:23+00:00 2026-06-04T04:37:23+00:00

Here’s my situation. I’m setting up a development server and a production server on

  • 0

Here’s my situation. I’m setting up a development server and a production server on PHP Fog. I have one set of files on my local machine that I’d like to be able to work on and push to each of the 2 servers on PHP Fog.

I want my development server to be protected though, using traditional htpasswd/htaccess methods. This means the production server needs to ignore those two files in my working copy.

Is there a way to tell the production server to ignore those two files when a commit is made but let them go through when pushing to the development server?

  • 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-06-04T04:37:24+00:00Added an answer on June 4, 2026 at 4:37 am

    I was looking in to this a while back as well and I used this article, it should explain how to use a single htaccess for multiple sites rather than worrying about git.

    Blog post: “Single .htaccess file in your git repo for both your dev and production server” by Mark Alan Evans

    He described the problem thusly:

    Problem:

    You want to have dev.yoursite.com and www.yoursite.com but you don’t want dev.yoursite.com visible to the public.

    Solution:

    If your using apache(which many of us are), .htaccess and .htpasswd to the rescue.
    In your .htaccess file add:

    SetEnvIf Host yourstagingserver.com passreq 
    AuthType Basic 
    AuthName “Staging Server” 
    AuthUserFile /path/to/.htpasswd 
    Require valid-user 
    Order allow,deny 
    Allow from all 
    Deny from env=passreq 
    Satisfy any
    

    Configure your password file on both dev & production

    Wherever you specify the /path/to/.htpasswd file, navigate to that folder from the console and type “htpasswd -c .htpasswd mark” where mark is the first user you want to create a login for.
    For each additonal person type “htpasswd .htpasswd linda” where linda is the next username you want to add to the .htpasswd file.
    Each time it will prompt you to type in the password twice (your password will be stored in the .htpasswd file) encrypted next to the username you created.

    Note:

    AuthUserFile expects an absolute path, but if you don’t start your path with a forward slash, it defaults to the directory you specify in your httpd.conf file as ServerRoot.

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

Sidebar

Related Questions

Here's my situation: I have a Data Template set up which contains a ToggleButton
Here's my situation. I have a DotNetNuke application. I want to link to an
Here is what I am trying to achieve in PHP: I have this string:
Here is a complete example. I want to forbid using A::set from objects casted
Here's the basic setup: I have a thin bar at the top of a
Here is my problem : I have a post controller with the action create.
here is my configuration: http://domain.com (obviously fictitious name...) hosted on a server running Apache
Here is an example: I have the generic type called Account. I wish to
Here's the setup - I have a view that lists products. On that same
Here is the situation. I am making changes to an application but I do

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.