InMotion Hosting Support Center

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

Category: Domain Names

2011-12-18 7:08 am EST

Hits: 8,411
I changed my index.html to a completely different file and when i type in it actually goes to my site but when i just type in my browser it gives me that page i got when i signed up.

You must login before you can ask a follow up question.

You must login before you can submit an answer.

Best answer chosen by InMotion Hosting staff


Tim S
13,821 Points
2011-12-19 10:11 am EST
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 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:

<div class="code_block">RewriteEngine on
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^(.*)$$1 [R=301]

If you need further assistance, please feel free to contact us.

Thank you!

Tim S

You must login before you can post a comment about this answer.

Like this Question?

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!