logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: How to select a specific file with a path using .htaccess
Author
Dareros



Joined: 14 Jun 2014
Posts: 5

PostPosted: Sat 14 Jun '14 16:29    Post subject: How to select a specific file with a path using .htaccess Reply with quote

Hi;
I want to select a specific file by its path using .htaccess to allow access to it. Here is what i have tried.

Code:
<Files "/var/web/site/system.log">
    Order Allow,Deny
    Allow from all
</Files>


Code:
<Directory /var/web/site>
     <Files "system.log">
         Order allow,deny
         Allow from all
     </Files>
</Directory>


The first didn't work and second give me a 500 internal error. I must use .htaccess for this task and not httpd.conf because i am using shared hosting which of course didn't allow access to httpd.conf.
Thank you
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Sat 14 Jun '14 21:57    Post subject: Reply with quote

Are all files denied or why do you need to make that one accessable?

I would use

Code:
<Files "system.log">
    Order Allow,Deny
    Allow from all
</Files>


within a .htacces in /var/web/site/ folder
Back to top


Reply to topic   Topic: How to select a specific file with a path using .htaccess View previous topic :: View next topic
Post new topic   Forum Index -> Apache