How do I redirect www site to the non-www version?

Asked by:
onlin164 / 64 Points
Time:
2013-09-05 11:53 am EST
Category:
Domain Names
Hits:
728
Greetings team Web Hosting Hub!

I would like domain to redirected from www to http//: xxx.com / in order to avoid duplicity SITE for better indexing in search engines.
I tried to change it through the section "Redirects", which, in turn, reports:
"You cannot redirect" "to" http://xxx.com "as this will cause a redirection loop because" / home / username / public_html / "is at the same place as" / home / username / public_html / ."

How nevertheless do it?
In advance I thank you for the help me.

Yours faithfully, Vsevolod M.

To ask this user for more information, please first login.

To submit an answer, please login.

ANSWERS

0

johnpaulb-whh2
Staff
9,661 Points
2013-09-05 12:29 pm EST
Hello Vsevolod,

Thank you for your question. You can force all sites to load with or without the "www," I recommend following our guide here, as it explains how to code your .htaccess file.

If you have any further questions, feel free to post them below.
Thank you,

-John-Paul

To submit a comment on this answer, please first login.

Dear John-Paul!
Thanks for your answer!
But something does not work this directive :
# Force non-www:
RewriteEngine on
RewriteCond% {HTTP_HOST} ^ www \. Example \. Com [NC]
RewriteRule ^ (. *) $> Http://example.com/ $ 1 [L, R = 301]
Redirection is not happening!
In addition, pops up a window for a username and password.
How to get rid of the showing this window which constantly pops up after you enter the address with the www.xxx.com?

In advance I thank you for the help me.

Yours faithfully, Vsevolod M.
onlin164
64 Points

2013-09-05 1:05 pm EST
Hello Vsevolod,

After updating your .htaccess file, you may have to clear your browser cache, which may be affecting your results.

Also, other rules in the .htaccess file may be interfering with this rule. Have you tried moving the rule, so it is next to other "Rewrite rules" ?

We are happy to help, but can you provide a link to the domain, so we can troubleshoot more effectively?

If you have any further questions, feel free to post them below.
Thank you,

-John-Paul
johnpaulb-whh2
9,661 Points
Staff
2013-09-05 1:33 pm EST
Please, my domain http://online-unity.com/
onlin164
64 Points

2013-09-05 1:58 pm EST
Hello Vsevolod,

I went and tested the domain name - it's changing the URL to the non-WWW version as per the request. If I type www.online-unity.com, it changes to "online-unity.com".

Please make sure to clear your browser cache. It should be working with no problems. I added the lines to your .htaccess file - the one you had active on your account was blank.

Please let us know if you continue to require any further assistance.

Regards,
Arnel C.
arnelc
13,735 Points
Staff
2013-09-05 2:34 pm EST
Dear Arnel C.
Thank you very much!
Good luck!
onlin164
64 Points

2013-09-06 9:17 am EST
Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

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

Not a Customer?

Get web hosting from a company that is here to help.