How to Hide Directories in Search?
-
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?
-
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.
-
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.
-
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.
-
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.
-
Will turning of directory browsing affect Search for all directories?
-
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.
-
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/
-
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.
-
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.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Not appearing when www.domainname.com.au is searched
We are working on an SEO campaign that has an issue, of which we are unsure of the cause. When the domain is searched for in Google as domainname.com.au. The search results show the website just fine. See here for the display of this. http://imgur.com/a/Vcbqs However, when the domain is searched for in Google as www.domainname.com.au. The search results do not display our website. See here to see this issue. http://imgur.com/a/jX692 We are unsure why our website does not appear in Google's listings when the www. is added in search. If anyone can help us here to explain and help us resolve this, that would be much appreciated.
Intermediate & Advanced SEO | | Gavo0 -
Change of Address in Google Search Console
I have merged domains before and it went rather smoothly following the Moz Guide - https://moz.com/blog/save-your-website-with-redirects . I've got a new challenge ahead of me though in that a client is buying the blog subdirectory associated with another domain. So it's the blog only, not the complete domain therefore a change of address for a site section doesn't exist. I believe the course of action will be the same except we'll just skip the change of address step since the original owner wants to maintain the TLD. Part of the contract is that we'll get the content which will be ported over to our domain and he'll maintain the 301's as requested and into perpetuity. Our domain is not brand new and has some credible links. Anyone encounter a transition of a partial domain before? Thanks for your help/suggestions.
Intermediate & Advanced SEO | | seoaustin0 -
Redirect Search Results to Category Pages
I am planning redirect the search results to it's matching category page to avoid having two indexed pages of essentially the same content. Example http://www.example.com/search/?kw=sunglasses
Intermediate & Advanced SEO | | WizardOfMoz
wil be redirected to
http://www.example.com/category/sunglasses/ Is this a good idea? What are the possible negative effect if I go this route? Thanks.0 -
List of Search Engines subscribing to the ajax crawling scheme?
Hi, Does anyone have a list of (major) Search Engines that subscribe to the Ajax Crawling Scheme? (https://developers.google.com/webmasters/ajax-crawling/) Specifically interested in major international Search Engines such as Bing/Yahoo, Baidu & Yandex - if anyone knows, please let me know! Thanks in advance
Intermediate & Advanced SEO | | FashionLux0 -
Places Listing in Search Results
Hi everyone, We have a company that hired us to set-up their Google Places listing for their 2nd location. The listing for the 1st location is very strong. Lots of reviews, Zagat rating, Knowledge graph, etc. In the search results the Google Places listing for the 1st location has merged with the website listing. You can see the link to the main site w/ a small grey google places listing directly below it. The client would like BOTH Google places listing to show up in the search results. They both show up on the map listing but not in the search results. Each location has its own listing in Google Places. We have also created different pages on the website for each location. Is there a way to get the search results to display places listings? I have noticed a few other business have done it by naming each of their multiple locations something slightly different. Then the search results seem to realize there are multiple locations and display the places listing in the search results. Anyone run into this? Any ideas? Thanks!!
Intermediate & Advanced SEO | | SeattleJoe0 -
Block search engines from URLs created by internal search engine?
Hey guys, I've got a question for you all that I've been pondering for a few days now. I'm currently doing an SEO Technical Audit for a large scale directory. One major issue that they are having is that their internal search system (Directory Search) will create a new URL everytime a search query is entered by the user. This creates huge amounts of duplication on the website. I'm wondering if it would be best to block search engines from crawling these URLs entirely with Robots.txt? What do you guys think? Bearing in mind there are probably thousands of these pages already in the Google index? Thanks Kim
Intermediate & Advanced SEO | | Voonie0 -
Free Directories - Yes or No?
Clearly, we see that high authority directories like Dmoz.Org are effective, even if this big monster is practically dead because of how unresponsive it is. What about other free directories? Is it worth obtaining as many listings as possible in the free directories? what about the paid ones? Is this still good SEO strategy if the directories have at least a PR3-4 or many cases higher? I'm asking this for an established site, so I understand that it won't help for deep-linking and anchor text, but will it help anyway to get links from these? If you like this post, help me out by giving me a Big Thumbs Up!
Intermediate & Advanced SEO | | applesofgold0 -
Content on New Domain or Sub Directory of Existing Domain?
I have a client with a well aged, high DA site. They rank well for their wedding photography business in several cities. They are launching a new service which is related to photography (photobooths and flipbooks) which they built and developed content on a new domain. The existing domain has 0 links with a DA of 1. The site is brand new.. Is there any drawback to moving the existing content on the new domain to a sub directory of the high authority domain? EX: http://domain.com/newcompany The look, feel, and design of the new site / service is much different than the high DA site. My thoughts are that this will give them an automatic step up, especially since they will be marketing this in several major cities. Also, since the design will be different, if it is good to move to the subdir, should we put the new company name in the subdir folder or something keyword friendly like domain.com/photobooth as opposed to domain.com/newcompanyname. Any thoughts would be greatly appreciated.
Intermediate & Advanced SEO | | itrogers0