1

I have a Godaddy hosting plan with a domain (let's use examplegodaddy.com). I use that as my main domain with a Wordpress site. I created a subdomain inside the cpanel (let's call it example.com/subdomain) and installed wordpress on it. Tested it and it works okay.

Few years back, I purchased a domain from Name.com which I renew every year (let's call it examplename.com).

Now I want to use examplename.com as the address for the subdomain example.com/subdomain.

I've been able to configure the A records and nameservers to examplename.com so that it will point to example.com/subdomain. But what happens is that when I type examplename.com in the browser, the address becomes "example.com/subdomain"

Is there anyway to make the browser load the example.com/subdomain wordpress site but the address is "examplename.com" ?

I've been trying for almost a week and had no luck. I'm also new to hosting, domains, servers and other stuff related to this. Any help would be much appreciated. Thank you in advance for the answers!

  • 1
    What you are showing is not a subdomain. If the domain is example.com, a subdomain of that would be tom.example.com where "tom" is the subdomain of example.com. What you are showing is merely a directory within example.com – Rob Sep 6 '16 at 21:41
1

If they are available on the Godaddy hosting plan, use cPanel addon domains. This will allow emails and other goodies too.

Navigate to addon domains. Fill in the first field (without the www), and it should generate a subdomain utility url/alias on top of the main server domain. For the document root, pick whatever folder you want, or the root public_html. In your case, it's the subdomain folder. Warning: if you pick the root public_html, then later decide to remove the addon/subdomain, DO NOT click delete the root dir. Doing so would wipe any sites under public_html. Same goes for FTP users on this new addon domain.

Ok now, what if Godaddy does not allow addon domains? Simple, just point the A record of examplename.com to the IP that runs your cPanel account. Then, since you are prob running Apache without access to vhosts, edit/or make a .htaccess file within the public_html alongside the subdomain folder.

in /public_html/.htaccess here is what a route would look like, dumping and masking the subdomain folder:

RewriteCond %{HTTP_HOST} ^(www.)?examplename.com$ [NC]
RewriteRule ^(.*+)$ subdomain/$1 [L,QSA]

Depending on what runs in that folder, you may need to adjust the apps .htaccess as well. Both the route, and perhaps the RewriteBase. Say Wordpress is running in /public_html/subdomain for example. In /public_html/subdomain/.htaccess you would need to change the rule for index.php from:

RewriteRule . index.php [L]

to this:

RewriteRule . index.php$1 [L]

In order to pick up the route from the higher level /public_html/.htaccess. Then in that same file, change/add base for your subdomain folder. This is for relativity:

RewriteBase /subdomain

If all is well, it should "just work" via either method.

0

No the address is going to show the real address the webpage belongs to.

Your option is to copy the files from subdomain to the other examplename.com and redirect the subdomain to the new domain.

0

In the control panel of examplegodaddy.com, go to Add-on domains and add examplename.com and link the domain to public_html/subdomain.

public_html may vary by name, but it is the root directory to examplegodaddy.com.

If you cannot access add-on domain, go to examplegodaddy.com directory, edit the .htaccess file to

RewriteRule ^/(.*)$ http://examplename.com/$1 [NC,L]

That should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.