stop listing of directory using url

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jyaseen
    New Member
    • Feb 2010
    • 21

    stop listing of directory using url

    How can I stop the web visitors ,if they are trying to display the folder content ,using URL
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    simply put an index.html in every directory. (although you could also deactivate directory listing (in Apache you’d do that with .htaccess))

    Comment

    • jyaseen
      New Member
      • Feb 2010
      • 21

      #3
      Originally posted by Dormilich
      simply put an index.html in every directory. (although you could also deactivate directory listing (in Apache you’d do that with .htaccess))
      Thank you for your reply,
      Here I know how to add index.html file.
      but I don't know how to use .htaccess file . if you don't mind can you explain how to use it.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        quick look at the Apache documentation
        Code:
        <Directory /path/to/directory>
           Options -Indexes
        </Directory>

        Comment

        • jyaseen
          New Member
          • Feb 2010
          • 21

          #5
          I add index.php file in my all directory including images, but now it is not displaying images in website.
          even after i delete all index.php file , still it is not working

          Comment

          • jyaseen
            New Member
            • Feb 2010
            • 21

            #6
            Originally posted by jyaseen
            I add index.php file in my all directory including images, but now it is not displaying images in website.
            even after i delete all index.php file , still it is not working
            sorry, my dear it was my mistake, now it is working.

            Comment

            • jyaseen
              New Member
              • Feb 2010
              • 21

              #7
              Originally posted by Dormilich
              quick look at the Apache documentation
              Code:
              <Directory /path/to/directory>
                 Options -Indexes
              </Directory>
              I am totally new to .htaccess , I did not understand what you wrote above , where I have to put this code.

              Comment

              • Dormilich
                Recognized Expert Expert
                • Aug 2008
                • 8694

                #8
                • create a text file
                • put the code above in
                • save as ".htaccess" in the topmost Apache web directory concerned

                what the code does, is disabling the directory display

                Comment

                • Markus
                  Recognized Expert Expert
                  • Jun 2007
                  • 6092

                  #9
                  This can also be done in your Apache .conf files.

                  Comment

                  • hitendrap
                    New Member
                    • Sep 2009
                    • 9

                    #10
                    For Linux if the .htaccess doesnt work'

                    then just put that code in httpd.conf file normally found @ /wwwroot/conf the Apache Installation directory

                    Or edit the directory tags folln' code worked for me applies to all directories
                    Code:
                    <Directory />
                        Options FollowSymLinks
                        AllowOverride None
                        Order deny,allow
                        Deny from all
                    </Directory>

                    Better read apache manual for more info

                    Comment

                    • Dormilich
                      Recognized Expert Expert
                      • Aug 2008
                      • 8694

                      #11
                      This can also be done in your Apache .conf files.
                      if you can modify that. not allowed on every web host. (esp. if you’re not the owner)

                      Comment

                      Working...