Jump to content

[SOLVED] <Files> .htaccess deny from all


sawade

Recommended Posts

I'm sure there must be away, but again I know nothing about how to write the .htaccess file.  I have looked up tutorials and whatnot, but they all seem to be written in gibberish.

 

In my file I have the following:

<Files .htaccess> 
deny from all 
</Files>

 

I was wondering if I can apply this same principle to other files?  Example:

 

Exclude error_log

Exclude /folder1/folder2/filename

Exclude /folder1/folder2/folder3/ (all files)

 

I have this at the beginning of my file, if it helps...

 

Options +FollowSymLinks

# DISALLOW includes to execute code

Options +includesNOEXEC

# DISALLOW peek into directories without an index file

Options -Indexes

RewriteEngine On
RewriteBase /

AddHandler application/x-httpd-php5s .php

Link to comment
https://forums.phpfreaks.com/topic/172952-solved-htaccess-deny-from-all/
Share on other sites

Place a .htaccess file in /folder1/folder2/ with the following code

deny from all

 

Now now one will be able to browse to any files/folders placed within yoursite.com/folder1/folder2/

 

I can't just keep it in the main directory and reference folders?

I tried this, but it made it so the website is not viewable at all.

 

<Directory />
AllowOverride None
</Directory>

<Directory />
Order Deny,Allow
Deny from all
</Directory>

<Directory /folder/folder>
Order Deny,Allow
Deny from all
</Directory>

UserDir disabled root

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.