Force www access

PHP re-direct:

Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );

htaccess re-direct:

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://domain.com/$1 [r=301,nc]
 
Back
Top