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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:15:20+00:00 2026-06-10T00:15:20+00:00

I have searched Google but couldn’t figure out how to do this thing: How

  • 0

I have searched Google but couldn’t figure out how to do this thing:

How can I block access to a specific directory if the request is done on a specific host.

Let me give an example.
I have a.com and b.com etc. addresses pointing to the same document root (the /).

I need to block the access to /sites/private/ directory unless the request is coming using a.com. The /sites/private/ directory should only be accessible if the request is done using a.com.

Thanks.

  • 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-10T00:15:22+00:00Added an answer on June 10, 2026 at 12:15 am

    I can’t test this right now, but this piece of code stolen and modified from here using SetEnvIf might help:

    SetEnvIfNoCase Host "a.com" HTTP_MY_HAS_HOST
    Order Deny,Allow
    Deny from All
    Allow from env=HTTP_MY_HAS_HOST
    

    you can use regular expressions for the host name.

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

Sidebar

Related Questions

I've searched google and SO for a solution to this problem but have not
Hi I have searched Google my best but couldn't recover from these errors: The
I searched google but couldn't find an answer to this rather simple question. I
I searched Google for a question I ask myself since this morning but couldn't
I have searched a bit on google, but didn't really found an answer to
I've searched the iPhone documentation and on google but have not found any information
I have already googled and searched stackoverflow but I can find nothing related to
I have searched around Google and StackOverflow trying to find a solution to this,
I have searched this topic on google a bit and seen some best practices.
I've searched (google and SO) about this topic and couldn't find a thorough answer

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.