How do I not show the directory structure?

When you access a folder, or the main page on the site, you see a directory structure instead of a website.  Most times you do not want your visitors to view the structure of your site and instead you would want to either redirect the visitor to an alternate location, or redirect them to a specific file. 

The majority of times these situations are run into when you have a section for forums or for your online store which is installed in it's own directory (xcart, phpbb, forum etc).  When a visitor comes to your main page of your site they see folders for the different areas instead of the actual content you want them to see. If you would like to configure it so that the webpages show up instead of the directory listing you can do one of three options:

  1. Create an index.html file which would act as a welcome screen before entering the store.
  2. Create a redirect using the /cpanel. From inside /cpanel click on redirect visitors to your site to different pages. For more information on redirects, please see the Redirect Article in the Knowledgebase
  3. Move the contents of your store folder into the /public_html folder. If you do this, remember to change the config.php file's path and also verify the configurations in your Admin Section for the database.

The most common solution by users seems to be to add an index.html or index.htm file to the folder and stop the visitor from viewing the files and folders in the site.

Reviewed: 11/05/2016

  • Email, SSL
  • 13 Users Found This Useful
Was this answer helpful?

Related Articles

What if I need more hard drive space or bandwidth? - delete

Submitted by user: I need more HD space.. There are a few other companies out there that are...

What language can I program in? Where can I download scripts?

For the most part PHP is the most common scripting on the web. Many other scripts and programs in...

Help - my site's been infected by a Virus

The viruses that attach themselves to web pages are unfortunately common, and though they are...

Fix for FrontPage hit counter on subdomain

Problem: You're using MS Front Page with web bots. The hitcounter works fine on your main domain,...

Can you tranfser files from my old host to you?

If your current web hosting provider has cPanel all you would need to do is create a BACKUP of...