Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.htaccess deny from all

Tags:

.htaccess

I have copied one of my old applications and renamed it to New_application. I want to access .htaccess file that is inside the New_application folder. When I opened it with my text editor, it just showed "Deny from all". I tried to open .htaccess in my old application, it showed 'Deny from all' too. I remember I was able to edit it before but not sure what I can't now. Any thoughts? Thanks a lot.

like image 806
FlyingCat Avatar asked Feb 29 '12 22:02

FlyingCat


People also ask

What does Deny from all do in htaccess?

You just need to add a few commands to . htaccess to make it happen. For example, deny from all is a command that will allow you to apply access restrictions to your site.

How do I deny access to my site with an .htaccess file?

htaccess IP deny access. To deny access to a block of IP addresses, simply omit the last octet from the IP address: deny from 123.456. 789.

How do I restrict IP address in htaccess?

In this tutorial, you've learned the easy way to block or allow visitors from specific countries. All you need to do is generate the country's IP address via Country IP Blocks, then insert an access control list (ACL) into your . htaccess file. We hope that this guide was helpful.

What is FilesMatch in htaccess?

htaccess file, the use of FilesMatch tags to block access to certain file extensions or to allow access to a specific list of filenames.


2 Answers

Deny from all  

is an .htaccess command(the actual content of that file you are trying to view). Not a denial of being able to edit the file. Just reopen the .htaccess file in the text viewer of choice and make the alterations as you so desire, save it, then reupload it to your folder of choice.

Though I think inadvertently you are blocking even yourself from viewing said application once uploaded.

I would do something like:

order deny,allow deny from all allow from 127.0.0.1 

which will deny everyone but the IP in the allow from line, which you would change the IP to match your IP which you can obtain from http://www.whatismyip.com/ or similar site.

like image 90
chris Avatar answered Sep 22 '22 08:09

chris


This syntax has changed with the newer Apache HTTPd server, please see upgrade to apache 2.4 doc for full details.

2.2 configuration syntax was

Order deny,allow Deny from all 

2.4 configuration now is

Require all denied 

Thus, this 2.2 syntax

order deny,allow deny from all allow from 127.0.0.1 

Would ne now written

Require local 
like image 43
gasp Avatar answered Sep 22 '22 08:09

gasp