Is it possible to use URL forwarding to point a domain to a folder on a server transparently?
I've been using a free web host that gives me a free subdomain. In addition to that, I can create two subdomains off of that.
The former involves iframes and breaks everything about the web that makes sense, and the latter involves simply going to a different domain. I'd like to be able to simply point the new domain at the current free subdomain, or any subfolder of that domain and have it transparently act as the root.
Essentially, the free server would just host the file and the domain would point to. I'm trying to avoid having purchasing a server to put the files on.
I think an "add on domain" would work. But I am only able to create 2 of them with the free host. So it seems like I would only be able to use 2 domains with the host.
Is there some service I can use that will map the server root to the appropriate folder and so on that I could use so that I host many different domains in different subfolders and somehow point the domains each to a different folder? Or would I need my own web server where I have more granular control over such options?
Possibly related to: Is it possible to use domain forwarding with masking without the use of iframe?
Set the DNS records to point the domain to the IP address of your hosting service. These are usually A records, but can be CNAME records for www and other subdomains.
Configure the web server look at the Host: header of HTTP requests and direct those requests to the files or code that power that web site. This is usually done by adding <VirtualHost> directives to Apache or by using "add on domains" in hosting front end packages like cPanel.
If your web host doesn't allow you to configure their web server for domain names, there isn't a lot you can do. Your only options are the redirect and framing options.
The good news is that web hosting is not very expensive. Finding web hosting should cost much less than other expenses you already have: registering domain names, and maintaining an internet connection to your home or mobile device.
They may inject ads and "powered by" into your pages.
They won't be around forever. Your free web hosting will shut down and leave you scrambling to find another host.
If you use their free subdomain, you probably won't be able to keep it after you stop using them. You will have to start all over with SEO, links, and bookmarks that have been driving traffic to your site.
Search engines don't like ranking content on free hosting and free subdomains because they see lots of spam created there.
I'd urge you to find some cheaper hosting plan with good reviews. It won't break your budget. It will be a lot better than free hosting.
The limiting factor is your "free web host". Basically, if this is something they do not support then you cannot do this. It may even be against their T&Cs.
Ideally you would be able to create an "Addon domain" (as you mentioned) or a "Domain Alias" (slightly different, but similar) at your "free web host". But this is unlikely something that your web host allows on its "free" plan.
Note that "Addon domains" are very different to "Subdomains" that you mention in your opening sentence.
In theory, you could purchase a server elsewhere (to which your domains point) that you configure as a reverse proxy and host all your content on the "free web host". But your "free web host" will likely block any such attempts and they may even ban you!
Not the answer you're looking for? Browse other questions tagged domains multiple-domains shared-hosting or ask your own question.
Is it possible to use domain forwarding with masking without the use of iframe?
dns hosting - url forwarding - hiding forwarded url?
How do I change where a domain points to?
Can I point a domain to a specific folder in the host?
Is it possible to point my domain to a DDNS?
Point more than 1 domain to my shared server DNS?