How do I force the "WWW" version of my website using the .htaccess file?

Avatar
  • Answered
I changed my index.html to a completely different file and when i type www.topdfconverters.com in it actually goes to my site but when i just type topdfconverters.com in my browser it gives me that page i got when i signed up.
Avatar
Tim S.
Hi Garet, Thanks for posting your question. I'm more than happy to assist you. It appears you have already resolved the issue on your own. When I visit both URLs you have provided they display the same content. It appears now you are forcing WWW when you go to the toppdfconverters.com and redirecting it. Also, many times issues like this can be corrected by first attempting to clear your browser cache. Anytime you wish to force all your visitors to the "www" version of your website, this can be accomplished by using your .htaccess file. Here is the code snippet to add to your .htaccess file:
RewriteEngine on RewriteCond %{HTTP_HOST} !^www.your_domain.com$ RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]
If you need further assistance, please feel free to contact us. Thank you! Tim S