Subdomain "redirect" to IP address of external local server
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>
Related videos on Youtube
Stian Berg Larsen
Updated on September 18, 2022Comments
-
Stian Berg Larsen over 1 year
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 orCNAME
records do? But I cant get it to work. Or I don't really understand it =)Thanks for any help! =D
-
dan over 10 yearsYou'll need to wait for the DNS modifications to propagate, up to 72 hours.
-
Stian Berg Larsen over 10 yearsI 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
-
dan over 10 yearsOK, 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.