The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Intermediate & Advanced SEO
    4. How to Hide Directories in Search?

    How to Hide Directories in Search?

    Intermediate & Advanced SEO
    10 5 667
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • hfranz
      hfranz last edited by

      I noticed bad 404 error links in Google Webmaster Tools and they were pointing to directories that do not have an actual page, but hold information.

      Ex: there are links pointing to our PDF folder which holds all of our pdf documents. If i type in , example.com/pdf/ it brings up a unformated webpage that displays all of our PDF links.

      How do I prevent this from happening. Right now I am blocking these in my robots.txt file, but if i type them in, they still appear.

      Or should I not worry about this?

      1 Reply Last reply Reply Quote 0
      • icecarats
        icecarats last edited by

        I would suggest 301'ing them to their /index.htm or /pdf.htm equivalents. If you don't know, a 301 is a signal to a web browser (or search crawler) saying "this page has permanently moved, please go to (otherpage.htm) instead".

        Here's a good SEOMoz article explaining it a bit more:

        http://www.seomoz.org/learn-seo/redirection

        What might be more of a concern, is it sounds like your web server has directory browsing enabled. This could be a security issue (depending on your web server setup). Generally you don't want to expose directories if you don't have to because it gives a potential attacker insight into your system setup. Here's an example how to do it in Apache:

        www.camelrichard.org/topics/Apache/Turn_OffDirectoryBrowsing

        And IIS:

        technet.microsoft.com/en-us/library/cc731109(v=ws.10).aspx

        If you like I can confirm if you have open directories if you give me the link, either here or through private message.

        hfranz 2 Replies Last reply Reply Quote 3
        • Klarke
          Klarke last edited by

          Blocking it in robots.txt will work to hide it from search engines.

          If you want to hide it from users or people to who type in the url, you can simply drop a blank "index.html" in the /pdf folder.

          1 Reply Last reply Reply Quote 1
          • Mark_Ginsberg
            Mark_Ginsberg last edited by

            I'd create an index.html for the directory, and then redirect it somewhere. This way, you're capturing the inbound links and then rescuing some of the inbound juice.

            Otherwise, you can also check out this post for more info on other solutions and modifying your htaccess file to prevent the directory view - http://perishablepress.com/better-default-directory-views-with-htaccess/

            1 Reply Last reply Reply Quote 0
            • hfranz
              hfranz @icecarats last edited by

              I really don't want to 301 redirect them as they are just holding files. This is happening with my includes file too. that holds our header, footer, navigation etc. I can check with our hosting company to find out.

              1 Reply Last reply Reply Quote 0
              • hfranz
                hfranz @icecarats last edited by

                Will turning of directory browsing affect Search for all directories?

                icecarats hfranz 3 Replies Last reply Reply Quote 0
                • Dr-Pete
                  Dr-Pete last edited by

                  Agreed with Valerie that step 1 is to turn off those directory listing pages - that can be a security issue and you don't necessarily want people to see/access the whole list. Also, make doubly sure you don't have any internal links to that directory (Google crawled it somehow).

                  Generally, Robots.txt should prevent crawling, but it's not foolproof, and it's pretty bad about removing pages once they're indexed. If you can block the page from browsing and return a 404 for the root page, that should be fine. The other option would be to have the page removed in Google Webmaster Tools. You could request removal for the entire folder, but I'm guessing that you may want the actual PDFs indexed.

                  1 Reply Last reply Reply Quote 1
                  • icecarats
                    icecarats @hfranz last edited by

                    Basically it shouldn't really have an affect; those unformatted file listings are literally the web server automatically saying 'here's the files that are in this folder', there's no meta tags, description, on page elements, etc.

                    If you have these pages and they're ranking well, you generally don't want them to be. The automatic file browsing pages don't have your name, your company, etc. in them, and they're generally pretty ugly. They also theoretically could be 'stealing' juice from your 'real' pages, if your internal structure isn't flowing relevance properly.

                    Basically what I'm saying is that if these pages are having some kind of SEO effect, you probably don't want them to be since they're so basic.

                    Also I can't overstate the security concerns that directory browsing might be introducing. If someone can directory browse to where your code lives (.php, .aspx.vb, whatever) they may be able to read it. Code sometimes has important things like logins, passwords, merchant account ids, etc. in it that you definitely don't want people reading.

                    1 Reply Last reply Reply Quote 1
                    • hfranz
                      hfranz @hfranz last edited by

                      My hosting company turned off directory browsing and now everything is how it should be. So to my understanding, if the server sees a file that does not have a index file, it should not be view able and should be forbidden. This shoujld not affect us from an SEO standpoint should it? My hosting company said they disabled all directories in our site, however everything still works, except for the forbidden file directories.

                      1 Reply Last reply Reply Quote 0
                      • icecarats
                        icecarats @hfranz last edited by

                        Yes, a visit to example.com/dir should now return a 404 error (if you haven't done any redirecting/canonicalizing). This will increase your 404 count in Web Master tools but it's far preferable to the alternative. If you're not redirecting the robots.txt will eventually work and hopefully the links will just fall out of WMT.

                        1 Reply Last reply Reply Quote 1
                        • 1 / 1
                        • First post
                          Last post
                        • Wrong Search words coming in search console
                          poojaverify06
                          poojaverify06
                          0
                          5
                          78

                        • An improved search box within the search results - Results?
                          DennisSeymour
                          DennisSeymour
                          0
                          2
                          91

                        • Subdomains vs directories on existing website with good search traffic
                          JaneCopland
                          JaneCopland
                          0
                          8
                          930

                        • Do search results differ greatly when you search on mobile?
                          intSchools
                          intSchools
                          0
                          4
                          92

                        • Directories
                          HeatherBakerTopLine
                          HeatherBakerTopLine
                          0
                          5
                          1.4k

                        • Does Disallowing a directory also tell search engines to unindex?
                          HiveDigitalInc
                          HiveDigitalInc
                          0
                          2
                          444

                        • Directory VS Article Directory
                          AlanBleiweiss
                          AlanBleiweiss
                          0
                          2
                          420

                        • Block search engines from URLs created by internal search engine?
                          Dr-Pete
                          Dr-Pete
                          0
                          6
                          2.2k

                        Get started with Moz Pro!

                        Unlock the power of advanced SEO tools and data-driven insights.

                        Start my free trial
                        Products
                        • Moz Pro
                        • Moz Local
                        • Moz API
                        • Moz Data
                        • STAT
                        • Product Updates
                        Moz Solutions
                        • SMB Solutions
                        • Agency Solutions
                        • Enterprise Solutions
                        • Digital Marketers
                        Free SEO Tools
                        • Domain Authority Checker
                        • Link Explorer
                        • Keyword Explorer
                        • Competitive Research
                        • Brand Authority Checker
                        • Local Citation Checker
                        • MozBar Extension
                        • MozCast
                        Resources
                        • Blog
                        • SEO Learning Center
                        • Help Hub
                        • Beginner's Guide to SEO
                        • How-to Guides
                        • Moz Academy
                        • API Docs
                        About Moz
                        • About
                        • Team
                        • Careers
                        • Contact
                        Why Moz
                        • Case Studies
                        • Testimonials
                        Get Involved
                        • Become an Affiliate
                        • MozCon
                        • Webinars
                        • Practical Marketer Series
                        • MozPod
                        Connect with us

                        Contact the Help team

                        Join our newsletter
                        Moz logo
                        © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                        • Accessibility
                        • Terms of Use
                        • Privacy