bspacer1 bspacer2
webmail hosting forum clients about

Computer Co-op, CornerNET Internet Gateway, and PJR Solutions is owned by PJR Sales & Service. Quality products and online services since 1991. We can be your
Complete Computer Connection

Hosting @ $5.95

Domains @ $16.98
Home PagePortal HomeClient AreaAnnouncementsKnowledgebaseSupport TicketsDownloadsRegister

Knowledgebase
You are here: Portal Home > Knowledgebase > cPanel Related Issues > cPanel HOW-TOs > How to redirect www URLs to non-www?

How to redirect www URLs to non-www?

In order to redirect all requests for www.yourdomain.com to yourdomain.com, you should set the appropriate rewrite rule. This can be done by adding the following lines at the beginning of the .htaccess file in your public_html folder:

RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]


From now on, when someone accesses http://www.yourdomain.com s/he will be redirected to http://yourdomain.com.

Using this method is safe because it should not create any redirection loops nor it should interfere with other rewrite rules.



Was this answer helpful?

Add to Favourites
Print this Article

Also Read
How can I create different types of web redirect with my cPanel? (Views: 9271)
How can I enable anonymous FTP access in cPanel? (Views: 10293)
How can I retrieve the raw Apache access logs for my site? (Views: 2118)
How can I check my quota and bandwidth limits/usage? (Views: 11950)
How can I password protect a directory with cPanel? (Views: 11193)

Powered by WHMCompleteSolution


Copyright © 1994-2021 PJR Sales and Service All Rights Reserved