Access our premium support and let us know your problems, we will help you solve them.

0
No products in the cart.
  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #10794
    blankflyingcat
    Participant

    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.

    #10796
    blanksahand
    Participant

    You can edit it. The content of the file is literally “Deny from all” which is an Apache directive: http://httpd.apache.org/docs/2.2/mod/mod_authz_host.html#deny

    #10798
    blankchris
    Participant
    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.

    #10797
    blankgasp
    Participant

    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
    
    #10795
    blankandioak
    Participant

    A little alternative to @gasp´s answer is to simply put the actual domain name you are running it from. Docs: https://httpd.apache.org/docs/2.4/upgrading.html

    In the following example, there is no authentication and all hosts in
    the example.org domain are allowed access; all other hosts are denied
    access.

    Apache 2.2 configuration:

    Order Deny,Allow
    Deny from all
    Allow from example.org
    

    Apache 2.4 configuration:

    Require host example.org
    
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.