URL Rewriting Clean Folders

Here are a couple lines I like to use on sites to force the www subdomain throughout the site and also keep folders clean - meaning no /folder/index.html or /folder/index.php, instead they automatically go to /folder/. These techniques involve a 301 redirect so all your link juice is easily transferred and you avoid any duplicate content penalties.

RewriteCond %{HTTP_HOST} ^domain\.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]

RewriteCond %{THE_REQUEST} ^GET\ .*/index\.(php|html|htm)\ HTTP
RewriteRule ^(.*)index\.(php|html|htm)$ /$1 [R=301,L]

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • Reddit
  • Furl
  • NewsVine
  • Simpy
  • Slashdot
  • Spurl
  • StumbleUpon
  • YahooMyWeb
  • TailRank

Home | Apache | URL Rewriting Clean Folders