Portal Home > Knowledgebase > Site related HOWTO's > How to always redirect users to www.YOURDOMAIN.com

How to always redirect users to www.YOURDOMAIN.com

If you need to always have your visitors redirected to http://www.YOURDOMAIN.com, instead of http://YOURDOMAIN.com, then you can employ the mod_rewrite module we have installed on the server, and use an .htaccess file in your public_html folder with these contents:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^YOURDOMAIN.com [NC]
RewriteRule ^(.*)$ http://www.YOURDOMAIN.com/$1 [L,R=301]

(make sure to replace YOURDOMAIN.com with your actual domain name)
The "R=301" will use a 301 redirect which is search engine friendly. You can remove it if it is not needed.

If you need more information then please do not hesitate to contact us at support@solid-hosting.net.

Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read