Importance of website directory/folder structures

When creating a website, it is important to have a good directory/folder structure- instead of having all your files in the root directory next to you index.html file.

It may be fine in the beginning stages of your website, but after a few years when you have many pages up to hundreds or even a thousand- it then becomes very difficult to manage your website and find stuff, because all your files are all over the place in the root folder. This is what happened to me. All my files were in the root directory. I had to move them into another folder.

The best thing to do, which also helps search engine spiders and robots index your site better is to have different folders/directories for different types of content. For instance if I had known about this from the beginning I would have a folder named “health”, a folder named, “spiritual” etc- all the
the different types of content on my site. This offers better management, organization and indexing of your pages.

It is impossible to administrate your site properly when you have all your files in the root directory. If your website is only going to have a few pages then fine, but otherwise your are going to be stuck. You will need to do something about this as soon as possible before your site gets any bigger.

It sounds simple just to move files. But any webmaster knows that moving files may be a complete disaster- because each page on a website should always have a permanent web address. If you move a page somewhere else, Google and all major search engines will treat it as a new page. It will then be given a page rank of less than zero and may not appear in the SERPS. It would mean that nobody would be able to find your pages in Google at all to begin with. When someone clicks on a page through Google- that page will no longer exist. It may destroy all organic traffic to your website.

How to safely move and redirect web pages with Apache web server using .htaccess files.

I found an excellent way of resolving this problem using a special type of “redirect” whereby the pages and the page rank gets redirected. Even though the old version of the page in the root directory is no longer there, if sometime tries to access that- then Apache redirects or rewrites the URL to the new page. It is a very clean method of moving pages permanently. When someone types in the old page into the address browser, your web server rewrites it to the new address automatically- so people do not even know that they have been redirected. This technique prevents duplicate content and any of your pages disappearing temporarily from the Google SERPS. It means that any links to your old pages will be valid, and the page rank passed on. It is such as genius technique.

This technique is called, mod_rewrite.

You should have a file called, .htaccess in your root directory. If you do not then create a file and call it .htaccess.

For example I moved all my pages such as introduction.html out of the root directory to the folder, “way_to_happiness”.

To do this I would open up my .htaccess file and type the following:

RewriteEngine on
RewriteRule ^introduction\.html$ http://www.anxietymadewell.com/way_to_happiness/introduction.html [R=301,L]

Upload this to the root directory.

Now if you type, “http://www.anxietymadewell.com/introduction.html” into your browser see what happens. It gets rewritten to “http://www.anxietymadewell.com/way_to_happiness/introduction.html” automatically.

Then all your problems are solved.

Leave a Reply

You must be logged in to post a comment.