DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Marco has posted 3 posts at DZone. View Full User Profile

Add Www In Front Of Domain Name

  • submit to reddit
        Add 'www' in front of the domain name through .htaccess file.

For example will automatically redirect to

RewriteEngine On
RewriteCond %{HTTP_HOST} ^yoursite\.com
RewriteRule ^(.*)$$1 [R=permanent,L]