Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I've set up a local server running XAMPP. Localhost is working for the server, and I've forwarded port 80 on our router to allow for incoming connections. This also works. So I can now access my hosted webpage through the IP adress of our external IP.

We already have a domain hosted, and cPanel installed on another server that the domain is managed by (this is not our server, it's a paid hosting solution).

How do I set up cPanel so that I can "redirect" subdomain folio.site.com to the locally hosted website?

Simply creating a subdomain and a forwarder will forward the user to the correct place, but then the URL changes to the IP adress, which does not look pretty.

I simply want the URL to stay at folio.site.com while in the root there, and if you navigate to another page there (for example /projects.php) then the URL would read this: folio.site.com/projects.php

I guess this is what A records or CNAME records do? But I cant get it to work. Or I don't really understand it =)

Thanks for any help! =D

share|improve this question

1 Answer 1

up vote 1 down vote accepted

How do I set up cPanel so that I can "redirect" subdomain folio.site.com to my other locally hosted website?

As you likely already suspect, this wouldn't really be a "redirect", it's pointing a subdomain to an IP address, which is done with an A record. A CNAME would be used to point to a hostname, not an IP address.

To do this in cPanel, edit the DNS Zone for your domain (e.g., site.com) and add an A record for:

folio.site.com 14400 IN A <external_IP_of_XAMPP_server>
share|improve this answer
    
I've added A records like that, but nothing happens. Or rather, what ahppens is it's doing a regular redirect. =/ So it only swaps out the url with the IP. And I cant see the A record in my list. I see autodiscover.folio.site.com and autoconfig.folio.site.com and several more like that, but no only folio.site.com –  Stian Berg Larsen Sep 4 '13 at 8:50
    
You'll need to wait for the DNS modifications to propagate, up to 72 hours. –  dan Sep 4 '13 at 8:53
    
I manage the DNS in cPanel. I removed all my entires to the subdomain and "A Record", and just wanted to see what happened in IE. In IE, it actually worked! But I've now removed the entries, so I've added it again and I'm waiting to see if it works. Firefox however was stuck at actually redirecting me and showing the IP, but IE worked in showing the subdomain URL –  Stian Berg Larsen Sep 4 '13 at 9:13
    
OK, thanks for the update. You might try clearing all the cache in Firefox and opening another browser. The DNS changes are going to take time to propagate, so don't expect for it to resolve completely right away. –  dan Sep 4 '13 at 9:21
    
Ok =) Thanks mate! –  Stian Berg Larsen Sep 4 '13 at 9:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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