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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:57:51+00:00 2026-05-24T03:57:51+00:00

I have a site in development that is password protected using the the apache

  • 0

I have a site in development that is password protected using the the apache htpasswd.

How can I exclude request coming from FB share such that it is not password protected?

Meaning, I still want the site to be password protected when a user try to access through a browser, but if the request comes from FB share ping, it should allow it.

I see that FB share ping has this user agent, facebookexternalhit/1.1, but I’m not sure how to implement that.

Thank you,
Tee

  • 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-24T03:57:52+00:00Added an answer on May 24, 2026 at 3:57 am

    This answer assumes you’re using Apache 2.1 or later:

    With the mod_authz_host module, you can do access control by hostname in .htaccess or in the <Location> or <Directory> section of your httpd.conf file, for example:

    <Location />
      Allow from apache.org
      Allow from .net example.edu 
    </Location>
    

    Note that you can use partial domain names here, so http://www.apache.org would be allowed access in this example.

    To ensure that you have mod_authz_host installed, check for a line similar to the following in your httpd.conf:

    LoadModule authz_host_module modules/mod_authz_host.so
    

    One downside with this is that it will do a reverse lookup for each access, which may or may not be a performance issue for you.

    Another option is to restrict by User-Agent. However, this is an unreliable technique, because the User-Agent can be very easily spoofed. But it may be OK for your purposes depending on your paranoia level 😀

    To restrict by User-Agent, you need to make sure you’re loading the mod_setenvif module in addition to the mod_authz_host module. Check for a line similar to the following in your httpd.conf:

    LoadModule setenvif_module modules/mod_setenvif.so
    

    Then, you can configure the access control in <Location>, <Directory>, or .htaccess as follows:

    SetEnvIf User-Agent ^facebookexternalhit/1\.1 let_me_in
    <Location />
      Order Deny,Allow
      Deny from all
      Allow from env=let_me_in
    </Location> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a site using ASP.NET 3.5, located within a virtual directory that
Previously, using SVN, I would have a branch that was my development branch, which
I have a site in development with several web services (ASMX) that post important
I have been developing our php based site on a development box that was
So far during my site development I have been storing all my jQuery functions
Post-release, I have made one small change to one form in our development site
I want to setup a simple site and I don't have any web development
For example I have site http://localhost/site In IIS I set that 404 error causes
So I have site list on certain pages that basically just have links to
I have a site using a custom favicon.ico. The favicon displays as expected in

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.