Topic: Google indexed a directory (Read 653 times)
Bill Gates is my home boy
Gender:
Posts: 622
3877 credits Members referred : 2
« on: Mar 13, 2006, 09:31:01 PM »
OK, I had an error on a page (since fixed) and instead of linking to my articles.html page it linked to the articles directory.
Google appears to have followed and indexed that error and now my articles directory shows up on Google.
I fixed the error when I first found it; yet, Googlebot still visited it last night. Just doublechecked the files the bot visited on that cycle and all were correctly coded.
Is this something that will go away on its own, or should I ask Google to remove it? Is it better not to draw attention to it with Google and just leave it? Any thoughts?
Bill Gates is my home boy
Gender:
Posts: 622
3877 credits Members referred : 2
« Reply #2 on: Mar 14, 2006, 06:06:22 AM »
If you follow the link on Google, it brings up the directory and shows the files. Click on any of the files and they are shown correctly as they would appear had they been accessed from the website.
I mainly worry that it could somehow lead to a security problem.
OMG!I am geek
Gender:
Posts: 56
374 credits Members referred : 0
« Reply #4 on: Mar 14, 2006, 11:09:22 AM »
That's very easy to do.
Create a file called .htaccess and open it with a text editor.
Code:
ErrorDocument 404 /404error.php
Then you have to create the page 404error.php and put there your error message.
Bill Gates is my home boy
Gender:
Posts: 622
3877 credits Members referred : 2
« Reply #5 on: Mar 14, 2006, 06:13:51 PM »
I'm not sure I understand. If the page brings up the list how does it cause a 404 file not found error? Isn't it bringing up exactly what was asked for?
Bill Gates is my home boy
Gender:
Posts: 622
3877 credits Members referred : 2
« Reply #7 on: Mar 14, 2006, 06:20:49 PM »
Index.php? What is that? Would that prove cleaner?
I was thinking of the 404 error page thing, and making it direct to the actual articles page but if someone got a 404 for something else then that might not work so well.
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 8116
41653 credits Members referred : 3
« Reply #8 on: Mar 14, 2006, 06:30:26 PM »
The best solution is to create an html page that will have a little message like "The page you requested does not exist" and some navigation links from your site.
Then do the .htaccess thing.
I will try to rephrase what Thanos said.
Open a text editor (eg. Notepad)
Write this line :
Code:
ErrorDocument 404 /404error.php
Then save this file with the name .htaccess on your root folder of your site.
Then open again the text editor and write the html that you want to displayed when someone is visiting a non existed page.
Save this file with name 404error.php again in the root folder of your site.
Bill Gates is my home boy
Gender:
Posts: 622
3877 credits Members referred : 2
« Reply #9 on: Mar 14, 2006, 06:35:20 PM »
I think I am getting this better.
I have cPanel and found where I can change the browsing.
It says:
The index manager will allow you to turn indexes on or off for a directory. If indexes are off, people will not be able to see what files are in a directory that lacks an index file.
Does that mean if I turn it off people will still be able to view the files normally, or will it hide them completely? The index file they mention, is that the index.php?
I have a small understanding of the .htaccess file and already have one. Don't quite understand how all the code works; but what I have seems to be doing what it is supposed to be doing.
Sorry, for the newbie questions, this is my first website where I am responsible for the security too.