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

  • Home
  • SEARCH
  • 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 8146803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:07:34+00:00 2026-06-06T14:07:34+00:00

How can i configure this in my apache/htaccess configuration: I want HTTP-Authentication for all

  • 0

How can i configure this in my apache/htaccess configuration:

I want HTTP-Authentication for all files with one exception.
The files click.php and js/clickheat.js may be accessed from 1.2.3.4 without any authentication.

I tried FilesMatch, but i can’t invert it. So i can’t put require valid-user in there. I thought using SetEnv, but how do i check for it later?

<FilesMatch "(click\.php|clickheat\.js)">
    # what here?
</FilesMatch>

My other idea was to use mod_rewrite. Well, i can allow access to the two files from the given host and deny it from anywhere else. But how do i chain it with HTTP-Authentication?

# allows access to two files from the given IP
RewriteCond %{REMOTE_ADDR} 1\.2\.3\.4
RewriteCond %{REQUEST_URI} ^/click.php [OR]
RewriteCond %{REQUEST_URI} ^/js/clickheat\.js
RewriteRule (.*) - [L]

# denies everything else
RewriteRule (.*) - [F,L]

So my favourite solution would be enabling HTTP-Auth via RewriteCond/RewriteRule.

Background (or why i want to do this): I’m trying to secure a clickheat (http://www.labsmedia.com/clickheat/index.html) installation. And 1.2.3.4 is the remote running mod_proxy and redirecting access to these to files to our clickheat host.

  • 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-06T14:07:39+00:00Added an answer on June 6, 2026 at 2:07 pm

    Ok, i found a solution:

    Order Deny,Allow
    Deny from All
    
    Satisfy Any
    
    AuthType Basic
    AuthName "clickheat"
    AuthUserFile /var/www/clickheat/.htpasswd
    Require valid-user
    
    <FilesMatch "(click\.php|clickheat\.js)">
            Deny from All
            Allow from 1.2.3.4
    </FilesMatch>
    

    The key is the Satisfy Any which allows either IP- or Auth-based access.

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

Sidebar

Related Questions

I'm using Apache 2.2 and PHP 5.3.8. How should I configure .htaccess to redirect
My problem is this exception: Caused by: <openjpa-2.1.1-r422266:1148538 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: This configuration
The users of my app can configure the layout of certain files via a
Does anyone know of a DB setting in DotNetNuke, where you can configure ALL
I want to create an external js-file, in which I can configure the copy
Can I configure Redis slave to stop saving dumps? I have omitted all save
How can I configure my Eclipse installation to use classes from Apache Commons IO
How can I configure OpenEJB logging format? This is what what I see now
I need to configure my apache so it run particular php file every, say,
How can I configure my Apache server to run on port 80? My Apache

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.