How to Redirect Non-www to www URLs

Redirecting non-www requests to the www version of your website’s universal resource locator is useful for SEO functions. Not solely can it assist you to avoid duplicate content on the Google index, however, it’ll additionally avoid the chance of split page rank and or split incoming links. during this article, we’ll learn the way to send non-www to www URLs mistreatment the .htaccess move into your public_html folder.

Editing .htaccess File

Step 1:

  • If you are using cPanel, login into your account, and choose the File Manager.
cPanel login file managar

Step 2:

  • Navigate to the public_html directory, right-click on the .htaccess file and select Edit.
edit .htaccess file  in cPanel

Note-

Sometimes, dotfiles (files their names start with a dot) because the .htaccess file is hidden from the manager. to form them visible, click the Settings button within the top right corner and check the Show Hidden Files (dotfiles) option from the Preferences tab.

Step 3:

  • Insert the following lines under the Rewrite Engine On:

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

Where yourdomain.com is your actual domain name.

Redirect Non-www to www URLs

Step 4:

  • Don’t forget to switch the code together with your actual name rather than yourdomain.com. Once you’re done don’t forget to save lots of the changes.

Congratulations, you’ve got successfully enabled a .htaccess file which will redirect all visitors from a non-www URL to the www version of your website! Wasn’t hard in the least, was it?

Conclusion

There you’ve got it! By finishing this tutorial, you’ve got learned the way to redirect non-www URLs to www. From now on, when someone accesses

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

Hopefully, this tutorial was helpful. allow us to know within the comments below if you face any issues.

Best Hosting Deals

TechnoVimalhttps://technovimal.in
Hey, I’m Vimal K. Vishwakarma, A part Time Blogger, Youtuber & Affiliate Marketer and Founder of TechnoVimal.in, SarkariBhaiya.com and YouTube Channel. TechnoVimal is a website that provides you authentic information about SEO, SEM, blogging, affiliate marketing, social media marketing, and how to earn money through blogging.

DEALS

GET STARTED

GBWhatsapp APK Download (Updated) Anti-Ban v10.60 | Official

The official GBWhatsApp (GBWA) is a well-known WhatsApp MOD and an alternative version of the WhatsApp application one of the main chat...

WordPress Automatic Plugin v3.50.4 Free Download

Wordpress Automatic Plugin posts from almost any website to WordPress automatically. WordPress Automated Plugin is the best auto poster WP...

Divi Theme v4.5.5 Free Download – With Premade Layouts

Divi Theme Free Download: Divi is one of The Most Popular WordPress Theme In The World And The Ultimate WordPress Page Builder

WP Rocket v3.6.3 Nulled Free Download – Plugin for WordPress

WP Rocket Nulled Premium: is a WordPress caching plugin created to speed up WordPress websites with minimal effort. It is currently used...

Download Free Yoast SEO Premium v14.7 [Latest Version]

Yoast SEO Premium v14.7 Nulled is the latest version of a collection of premium SEO optimization plugins for WordPress. The collection contains Yoast News...

POPULAR NOW

3 COMMENTS

  1. How come my domain is always showing www no matter how I redirect it to a non-www name. eg. typing abc.com always shows up ww w.abc.com on the browser, I just want it to abc.com without www.

    • The redirect described in this article should work to force www .abc.com to abc.com. However, if you are using a Content Management System (CMS) like WordPress for example, you would need to configure WordPress to use the domain without “www”, otherwise it may result in undesired behavior. If you are using another CMS, let us know which one, we may have a guide to assist you with it.

LEAVE A REPLY

Please enter your comment!
Please enter your name here