Return to Snippet

Revision: 49430
at July 21, 2011 20:58 by theworldofdan


Initial Code
<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteBase /
	# redirect non-www to www
	RewriteCond %{HTTP_HOST} ^([a-z-]+)\.([a-z]{2,6})$ [NC]
	RewriteRule ^(.*)$ http://www.%1\.%2/$1 [R=301,L]
</IfModule>

Initial URL

                                

Initial Description

                                

Initial Title
redirect to www. domain without needing to hardcode domain

Initial Tags

                                

Initial Language
Apache