Jump to content

[SOLVED] <Files> .htaccess deny from all


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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.