Most people see and as the same page, but tìm kiếm engines don’t—they see them as duplicate content.

Bạn đang xem: How To Redirect Www To Non

Google sees duplicate nội dung as “appreciably similar” content in more than one URL.

The major problem with duplicate content is that it’s difficult for tìm kiếm engines khổng lồ decide on the version to lớn include in the search index và rank for query results.

This confusion could impact search engine rankings negatively.

But you could fix this by redirecting all non-www URLs lớn their www version, và thankfully, here’s how.

Redirecting Non-WWW URLs to lớn WWW

You can create website redirects by adding some lines of code khổng lồ your domain .htaccess file—a hệ thống configuration tệp tin that lets users make quick changes to lớn their server settings. Use this code to lớn redirect from non-www to lớn www.

RewriteEngine On

RewriteCond %HTTP_HOST ^

RewriteRule ^(.*)$$1

Please replace on the code with your tên miền name & save the changes.

Always add your redirect rules below the RewriteEngine On line, unless you have it already at the đứng top of the .htaccess file.


If you do, then use the code without the RewriteEngine On line lớn create the URL redirect.

RewriteCond %HTTP_HOST ^

RewriteRule ^(.*)$$1

Now follow these steps to add the rule to your .htaccess file.

Step 1: Log into SPanel’s User Interface.

Xem thêm:

The mặc định login URL is (don’t forget khổng lồ replace with your actual domain).

Step 2: xuất hiện the tệp tin Manager

Locate the FILES section on the homepage & click File manager.


Navigate khổng lồ your domain’s root directory in the tệp tin manager and xuất hiện it.

If you’re setting up the redirect for your root domain, then the root directory should be the folder named public_html.


If it’s for a subdomain or addon domain, choose the thư mục bearing its tên miền name.

Step 3: địa chỉ Your Code

Locate a file named .htaccess in the root directory, right-click the tệp tin to reveal a menu, then choose Edit to mở cửa the editor.


Now, copy & paste your redirect rule into the editor & save. Then, type your URL without the www in your browser khổng lồ confirm it’s redirecting to lớn the www version.

Need Support?

If you need assistance creating this redirect, kindly reach out lớn our support for quick help, & we’ll be available to help.

What’s your goal today?

1. Sign up to lớn our newsletter và keep up khổng lồ date with the latest news. Our team consist of highly skilled ex-sysadmins and hosting veterans, ready to nội dung their chất lượng hosting-related knowledge with you.

Sign up for monthly News Letter và we will keep you up to date about the most valuable pieces of nội dung we publish on our blog

2. Explore our VPS Hosting - with our 30-day unconditional money-back guarantee and free, effortless migration, you can try our award-winning Managed Cloud VPS solutions risk-free.

Related articles