When designing a website I created a top.php page to hold the essence of my page so I could just use include for each page. So top.php holds my head, with my CSS stylesheet and with it my background to the site and then the menu bar. I’ve used absolute positioning with my content so everything just sits on top of an image basically – the template. Impractical perhaps but it does look nice. Anyway if you were to access mywebpage.com/top.php you just see the template with no content obviously. Now it wouldn’t really be a problem because nobody would go to that link except Google has decided to include it in it’s search. Even though I’ve submitted a sitemap and hidden it on my Google Web Account.
Any solutions?
I’m not an experienced web designer obviously.
You should place all files that you only include in a directory, and block access to that directory using a
.htaccessfile.This will prevent Google as well as users from accessing the file directly.
Your
.htaccessfile should containdeny from allYou create a directory called ‘fragments’ and drop
top.phpin there. Then, within the directory create a new file called.htacess. The file should containdeny from all.Creating a file without any name and only an extension can be done this way:
deny from all".htacess"(with the quotes)