How To Redirect Non www URL to www URL of Your Domain| for stock rom go to rompure.com
Non-www
URL and www
URL of Your domain are considered different as in terms to Google and other search engines. They are considered as two url format for your site. There is need to fix it to prevent duplicate content by redirecting all your domain.com or domain.com/subfolder to www.domain.com or www.domain.com/subfolder.
How To Redirect Non www URL to www URL of Your Domain
This involves editing the .htacess file in the public_html folder or specifying the domain URL whether www.domain.com or domain.com when installing your WordPress software or other scripts.
Method One
Method One
For yourdomain.com to www.yourdomain.com
If you are using WordPress WordPress Dedicated Hosting. Click on FILES > File Manager, then navigate to the root folder( ensure Show Hidden Files is ticked).
Next, locate a file called .httaccess and click on it to edit it and edit it as shown below
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
Change
yourdomain.com
with your website name. After add it, when someone accesses tohttp://yourdomain.com
he/she will be redirected to http://www.yourdomain.com
For yourdomain.com/sub-folder to www.yourdomain.com/subfolder
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{REQUEST_URI} ^/sub-folder/
RewriteRule ^(.*)$ http://www.yourdomain.com/sub-folder/$1 [R=301,L]
Change
yourdomain.com
with your website name and also sub-folder
text with your existing sub-folder
name. After add it, when someone accesses tohttp://yourdomain.com/sub-folder
he/she will be redirected tohttp://www.yourdomain.com/sub-folder
Method Two
- Select the Redirects icon under the Domains area of your cPanel home page.
- Keep the Type as the default, Permanent(301).
- Select your domain name from the drop down menu on the next line.
- In the redirects to text box, type in the full URL of your domain, including www (e.g. http://www.yourdomain.com).
- Select the radio button next to Do Not Redirect www.
- Click the Add button to add your redirect.
That's it and you have successfully redirected yourdomain.com to www.yourdomain.com. Now your can submit www.yourdomain.com to Search engines to crawl.
Labels: How Tos, Webmasters
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home