129 Web Design is a Web Design, Web Development and Web Marketing firm based in Portland, Maine.
Checkout Our blog.  Discuss coding, random tech issues and off topic items. Login to your 129 portal.  The place to get information regarding web design, web development and web marketing services. Answers to common questions regarding our web design, web development and web marketing services.
Checkout our portfolio to see examples of web design, web development and web marketing. Checkout our services to learn more about web design, web development and web marketing. 129 Web Design is a Web Design, Web Development and Web Marketing firm based in Portland, Maine. See what's new in our world of web design, web development and web marketing. Contact us to learn more about our web design, web development and web marketing services. Have a question about our web design, web development and web marketing services?  Click here!

Using the DirectoryIndex property in .htaccess to improve search engine optimization and web site manageability

How it’s used:

Enter a line in your .htaccess file similar to the following:

DirectoryIndex  example.php

Special Notes:  This works with the Apache Web Server and does not work with IIS.  When editing the .htaccess file in a text editor, make sure “text wrapping” or “wrap text” is turned off.  Using “text wrapping” or “wrap text” will cause the .htaccess file to fail.

What it does:

Allows a developer to choose which file to use as the default file when a directory or a web site loads.

Why you should use this property:

Improve Search Engine Optimization:

  • Allows a developer to give a meaningful name to a “default“ file.
  • Allows a developer to inject keywords into the URL.

Compare the following URLs.

        http://thewidgeturl.com/index.html

        http://thewidgeturl.com/free_widget_downloads.html

The second URL allows the developer to inject keywords (free widget downloads) into the URL to improve search engine optimization.  The second URL’s file name is a better descriptor as compared to the file name, “index.html”.

Better site manageability:

By setting the DirectoryIndex property it allows a developer to control which file loads in a directory or which file is loaded when the web site’s root/homepage is accessed even if a hosting provider changes this property in the web server configuration files.

For example, your hosting provider may allow you to use a file named “index.php” to load when a directory or a web site is loaded.   Think of the following URL, http://thewidgeturl.com. In the root of the website is a file named index.php and this file loads as the homepage.  This works great, but, one day your hosting provider decides to change its policy and changes its web server configuration files to only load files named, index.html or index.htm when a directory or a web site loads.  Now, when a user visits your homepage, the web server looks for the files, index.html or index.htm, the files cannot be found and a 404 error is displayed to every visitor of your homepage – not good.

These are only two of the advantages of using the DirectoryIndex property in .htaccess.  For more information on .htaccess and the DirectoryIndex property visit the Apache website.

Check out all of our articles on search engine optimization and .htaccess

Using the DirectoryIndex property in .htaccess to improve search engine optimization and web site manageability

URL Rewriting with .htaccess and Apache to boost Search Engine Optimization

URL Rewriting with IIS (Internet Information Services)

Search Engine Optimization and 301/Permanent Redirects

 

One Response to “Using the DirectoryIndex property in .htaccess to improve search engine optimization and web site manageability”

  1. [...] Using the DirectoryIndex property in .htaccess to improve search engine optimization and web site ma… [...]

Leave a Reply


Portfolio | Services | Company | News | Contact | Site Map | F.A.Q. | RSS RSS / Subscribe | Current Promo | Partnerships | Privacy Policy | Terms & Conditions

129 Web Design & Marketing | PO Box 18207 | Portland, Maine 04112