Main GT Rd. Kharian,
Punjab, Pakistan
+92 301 620 2727
+92 335 620 2727
info [at] NinjaSofts.com
ninjasofts [at] gmail.com

How to redirect www URLs to non-www?

You can redirect all of the requests for www.yourdomain.com domain to yourdomain.com by modifying your website’s .htaccess file. You have to add the following lines in the beginning of the file so that the redirection is properly set up:

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

You should replace yourdomain.com with your actual domain name.

You can edit the .htaccess file using the File Manager in cPanel or via FTP.

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

 


Let us Manage Your Online Empire Ninja Softs