How to add www to a domain i own?

Messages
12
Reaction score
0
Points
0
I have a domain and have already set it as my primary domain name from 'Modify Domain' in x10hosting

But the address is like
http://domain.com

I want it to be like
http://www.domain.com


In advance dns zone editor i see it as (domain name hidden)
domain.com - 14400 - IN - A - [SOME IP ADDRESS]
www.domain.com - 14400 - IN - CNAME - domain.com


So basically what i see is www.domain.com redirecting to domain.com

Should i just swap the TYPE and RECORD for both of these go get the result i want?
 

techairlines

x10 Flyer
Community Support
Messages
2,867
Reaction score
165
Points
63
No, don't swap the records. The domain.com holds the A record and www holds the CNAME.

I just visited your site and you're running WordPress. Go to WordPress Settings > General and edit the WordPress URL and Site URL to a version with the www. This usually will create a 301 redirect for you but if it doesn't, continue reading.

Then, add these lines to the end of your .htaccess file (in root of public_html)

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

Replace domain.com with your domain name. This will create a 301 redirect from the non-www to www. Make sure you edit the WP settings first or it will cause a redirect loop.

(The .htaccess method is the general way to choose www or non-www but settings in any CMS software need to be changed as well.)
 
Last edited:

9mm.tylenol87

New Member
Messages
2
Reaction score
0
Points
0
I know this post is kinda old but I've noticed that if I type the subdomain that x10 gives you, while using a parked domain, that it doesn't change to the new domain that you have set. Is there a way to change this or am I barking up the wrong tree?

-Also I am using a free hosting account.
 
Last edited:

svrnl.ghosh54

New Member
Messages
11
Reaction score
0
Points
0
how to put wordpress on the root directory? i want my website on cellfrens.x10.mx and not on cellfrens.x10.mx/wordpress
 

tazosmr

New Member
Messages
1
Reaction score
0
Points
0
If in your root is a file called .htaccess, then open it and add this code into it (problably after the first line, bofore other rules start) .



Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
</IfModule>


( if there is not such file, then create a simple new text file with notepad and upload to the website root directory, and rename it to .htaccess )


This is 301 (which is permanent redirect), and then after a few weeks the site will be visible with www in Google search engines anymore.
 
Last edited:
Top