Get 50% Discount Offer 26 Days 

Contact Info

69, 4th Floor, Rayerbag ShoppingComplex, Jatrabari, Dhaka-1362

+8801608060430

support@bytesis.com

Client Area
Recommended Services
Supported Scripts
WordPress
Hubspot
Joomla
Drupal
Wix
Shopify
Magento
Typeo3

Introduction

When managing a website, ensuring that all visitors land on a single version of your domain is crucial for SEO and user experience. One common practice is redirecting www.yourdomain.com to yourdomain.com (non-www). This helps improve search engine ranking, avoid duplicate content issues, and consolidate website traffic. In this guide, we’ll show you how to set up this redirection using cPanel and .htaccess.

Why Redirect www to Non-www?

 

1. Improved SEO

Google and other search engines consider www.yourdomain.com and yourdomain.com as two separate websites if not redirected properly. This can lead to duplicate content issues and dilute your SEO rankings. By enforcing a single URL structure, you help search engines consolidate page authority and improve your rankings.

2. Better User Experience

Redirecting all traffic to a single version of your site prevents users from accidentally accessing different versions of your website. This ensures a consistent browsing experience.

3. Avoid Splitting Traffic and Backlinks

If your website is accessible through both www and non-www, backlinks could be split between the two versions, weakening your domain authority. Redirecting to a single version ensures all backlinks point to one domain, increasing its credibility.

4. Easier Site Management

Redirecting ensures that all your website configurations, cookies, and analytics are properly managed under a single domain.

How to Redirect www to Non-www Using .htaccess in cPanel

To implement this redirection, you will need to edit your .htaccess file. Follow these steps:

Step 1: Access Your cPanel

  1. Log in to your cPanel account.
  2. Navigate to the File Manager.
  3. Open the public_html folder (or the folder where your website files are stored).

Step 2: Locate or Create the .htaccess File

  • If you already have a .htaccess file, right-click and select Edit.
  • If the file does not exist, create a new file and name it .htaccess.

Step 3: Add the Redirection Code

Copy and paste the following code at the beginning of the .htaccess file:

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^yourdomain\.com$
RewriteRule (.*) http://yourdomain.com/$1 [R=301,L]

Step 4: Modify the Code

  • Replace yourdomain.com with your actual domain name.
  • If your website uses HTTPS, update the rule to:
RewriteRule (.*) https://yourdomain.com/$1 [R=301,L]

Step 5: Save and Test the Redirect

  1. Click Save Changes in the cPanel editor.
  2. Open your browser and visit www.yourdomain.com.
  3. It should automatically redirect to yourdomain.com.

Alternative Method: Redirect via cPanel Redirects

If you are not comfortable editing .htaccess, you can use the cPanel Redirects feature:

  1. Log in to cPanel.
  2. Go to Domains > Redirects.
  3. Choose Permanent (301) Redirect.
  4. Select your domain (www.yourdomain.com).
  5. Enter https://yourdomain.com in the Redirect To field.
  6. Click Add Redirect.

Verifying Your Redirection

After setting up the redirection, test it using:

  • Manually entering www.yourdomain.com into the browser.
  • Using online redirect checkers like Redirect Checker.
  • Checking SEO tools like Ahrefs or Moz to ensure proper redirection.

Conclusion

Redirecting www.yourdomain.com to yourdomain.com is essential for SEO, consistency, and website management. By implementing this redirection via .htaccess or cPanel, you ensure that search engines and visitors access a single version of your site, improving your overall site authority and user experience.

Following this guide will help consolidate your traffic and enhance your website’s SEO performance. If you experience issues, ensure your .htaccess file is correctly edited and that your hosting provider allows URL rewriting.

Share this Post

Leave a Reply

Your email address will not be published. Required fields are marked *