Sometimes in your domain building you will end up with a web directory structure that leaves a bunch of files exposed publicly. You may not want that.

This happens when you install the Yourls app — for example, visit the demo one at https://jump.extendlabs.ca/ Or when we created a Sandbox for our development work, the main directory representing the subdomain sandbox.gadgets.stateu.org has no web content in it.

This is not very pretty! But it also means that people can snoop inside your web sites if they see this directory view, merely by navigating to the top of the subdomain web address. This happens in a web server when there is no index.htmlindex.php, or default.html file in there, you just see files.

One way to avoid showing this web directory is to place an empty content index.html file inside the directory for the subdomain.  But we offer something a little more showy, a protective dog.

With a simple set of two files added to that directory, you can create a guard dog (or whatever image you like) to make as a page to block the file view. It uses a little bit of code called backstretch that scales a background image to fill the window side.

These are the 2 files you will get in this package (download the package now):

  • background.jpg
  • index.html

You can replace the background.jpg file with any other image (rename it the same name!); something at least 1024 x 768px will do well. And now if you are feeling brave, open the index.html file in a plain text editor, and edit any of the content inside the <div id="stuff"> section:

<div id="stuff">
<!-- edit ahoy -->

	<!-- the big title -->
	<h1>
		CogDogBlog Lab
	</h1>
	
	<!-- a clever tagline -->
	
	<p>
		Be Careful
	</p> 
	
	<!-- give credit for the image! -->
	<p class="small">
		cc licensed ( BY ) flickr photo by 
		Perfecto Insecto:
		<a href="http://flickr.com/photos/perfectoinsecto/4301508866/">
		http ://flickr.com/photos/perfectoinsecto/4301508866/</a>
	</p>
<!-- done editing -->
</div>

Use the Cpanel File Manager to uploads these two files to the directory you are guarding, and enjoy the beauty of your cleverness.

Example for "A Guard Dog For a Web File Directory":
https://lab.cogdogblog.com/

Complete This Kit

After you complete this kit please share a link to it and a description so it can be added to the responses below. You can add it directly to this site.

Add A Response

Guides for this Kit

Have you created a helpful guide or do you know one that might help others complete this kit? You can share a guide if it is available at a public URL. .

Add a Guide

1 Response for this Kit

  • The Agora Online
    by Alan Levine

    This domain was created to house the UDG Agora Project at http://udg.theagoraonline.net  with the idea future projects might be set up as subdomains, so there is no content at the main URL. Rather than a guard dog, there is just a nice photograph to prevent peeking at directories.  

  • 0 Guides for this Kit

    Creative Commons License
    This work by Alan Levine as part of the EduHack project is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

    Leave a Reply

    Your email address will not be published. Required fields are marked *