URL Rewriting Clean Folders
Like this blog? Consider exploring one of our sponsored banner ads...
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]
About this entry
You’re currently reading “URL Rewriting Clean Folders,” an entry on BRADINO
- Published:
- 11.9.07 / 6pm
- Category:
- Apache
- Tags:
No comments
Jump to comment form | comments rss [?]