Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Domain alias and redirect help
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Domain alias and redirect help

I'm using Cloudflare for DNS and "protection", for example.com domain.

I would like to do the following:

Create a web page at
test1.example.com/lowendtalk

Have visitors typing:
lowendtalk.example.com see the page, but having the lowendtalk.example.com shown in their browser.

Is this possible?
If so, how?

Don't think I should be configuring lowendtalk.example.com at any hosting server - since I am using Cloudflare as a DNS - correct me if I'm wrong.

If that's incorrect - how and what do I configure for it to work on a cPanel, and what on a DirectAdmin hosting server (reseller hosting)?

Comments

  • Others can correct me if there is a more simple way, but I'd just have a web page; lowendtalk.example.com/index.html, with an iframe of your other page (test1.example.com/lowendtalk). That way it'd show the other page, when accessing lowendtalk.example.com.

  • DPDP Administrator, The Domain Guy

    Stealth forwarding?

  • bikegremlinbikegremlin Member
    edited June 2020

    @thedp said:
    Stealth forwarding?

    Yes - but all will be on the same domain, just want to get the looks better (and shorter URL-s). Plan on using canonical tags on all the pages to show anyone interested what really is going on.

    Edit: for example:
    instead of example.com/bicycle-info/pdf/tutorials/documentation/derailleurs
    I want to be able to use:
    documentation.example.com/derailleurs

  • DPDP Administrator, The Domain Guy

    @bikegremlin said:

    @thedp said:
    Stealth forwarding?

    Yes - but all will be on the same domain, just want to get the looks better (and shorter URL-s). Plan on using canonical tags on all the pages to show anyone interested what really is going on.

    Edit: for example:
    instead of example.com/bicycle-info/pdf/tutorials/documentation/derailleurs
    I want to be able to use:
    documentation.example.com/derailleurs

    Yeah some domain registrars/DNS supports Stealth Forwarding, but I'm not sure about CF's DNS - I'm not using it.

    Perhaps iframe is the way to go, as mentioned by @PineappleBox

    Try this: https://www.a2hosting.co.uk/kb/developer-corner/setting-up-url-frame-forwarding

  • jarjar Patron Provider, Top Host, Veteran
    edited June 2020

    Reverse proxy is what you're looking for. It pulls the content from one domain and serves it under another. However, the content served can't try to redirect to it's "whatever.com/page" self or it'll still work like a redirect.

    @bikegremlin said: Don't think I should be configuring lowendtalk.example.com at any hosting server - since I am using Cloudflare as a DNS - correct me if I'm wrong.

    You have to unless CloudFlare is doing it for you (to the best of my knowledge they don't do reverse proxy where target content is different from URL). Some server has to be configured at the web server level to serve content under that URL, especially if you want an SSL cert on it. Whether it's your server or someone else's is up for discussion, but some server has to be. I'm intentionally excluding a scenario where your subdomain is the only website on a server and therefore is default and doesn't require it to be declared directly as the URL in the virtual host, as that isn't preventing any excess configuration.

  • @jar said:
    Reverse proxy is what you're looking for. It pulls the content from one domain and serves it under another. However, the content served can't try to redirect to it's "whatever.com/page" self or it'll still work like a redirect.

    @bikegremlin said: Don't think I should be configuring lowendtalk.example.com at any hosting server - since I am using Cloudflare as a DNS - correct me if I'm wrong.

    You have to unless CloudFlare is doing it for you (to the best of my knowledge they don't do reverse proxy where target content is different from URL). Some server has to be configured at the web server level to serve content under that URL, especially if you want an SSL cert on it. Whether it's your server or someone else's is up for discussion, but some server has to be. I'm intentionally excluding a scenario where your subdomain is the only website on a server and therefore is default and doesn't require it to be declared directly as the URL in the virtual host, as that isn't preventing any excess configuration.

    Any advice for a configuration in DirectAdmin (and/or cPanel for that matter)?
    I can set Domain pointers (Alias under cPanel?) - add subdomains, or create a separate DirectAdmin/cPanel accounts for the subdomains alone.
    Just can't figure out what to configure and how.

  • tetechtetech Member

    I do this in Apache using RewriteRule.

  • So far - managed to switch one for the other in cPanel (not in DirectAdmin), but without being able to shorten the URL (without a redirection, hence the longer URL still showing).

  • jarjar Patron Provider, Top Host, Veteran

    @bikegremlin said:

    @jar said:
    Reverse proxy is what you're looking for. It pulls the content from one domain and serves it under another. However, the content served can't try to redirect to it's "whatever.com/page" self or it'll still work like a redirect.

    @bikegremlin said: Don't think I should be configuring lowendtalk.example.com at any hosting server - since I am using Cloudflare as a DNS - correct me if I'm wrong.

    You have to unless CloudFlare is doing it for you (to the best of my knowledge they don't do reverse proxy where target content is different from URL). Some server has to be configured at the web server level to serve content under that URL, especially if you want an SSL cert on it. Whether it's your server or someone else's is up for discussion, but some server has to be. I'm intentionally excluding a scenario where your subdomain is the only website on a server and therefore is default and doesn't require it to be declared directly as the URL in the virtual host, as that isn't preventing any excess configuration.

    Any advice for a configuration in DirectAdmin (and/or cPanel for that matter)?
    I can set Domain pointers (Alias under cPanel?) - add subdomains, or create a separate DirectAdmin/cPanel accounts for the subdomains alone.
    Just can't figure out what to configure and how.

    If mod_proxy is enabled on the server you can try something like this in .htaccess:

    https://helpful.knobs-dials.com/index.php/Apache_config_and_.htaccess_-_URL_rewriting#Reverse_proxy

    Thanked by 1bikegremlin
  • bikegremlinbikegremlin Member
    edited June 2020

    Thanks for the link. It's been educational - though it didn't work on the servers I tried it with. :)

    Seems it's not very simple (on DirectAdmin, not even making an Alias domain seems to work as intended, though it could be down to the particular shared/reseller hosting servers I tried it with).

    Possible routes from here:

    • Getting a managed VPS and playing with it there (money pit).
    • Learning how to manage/secure a VPS (curious about it, but expect it to become a time-pit), then playing with it there.
    • Giving up because it's not that crucial - though I am curious on figuring out how to make it work (so it might become a temporary time-pit, as soon as my schedule cleares out a bit). :)
  • bikegremlinbikegremlin Member
    edited June 2020

    In case it helps anyone else:

    For basic HTML I got it to work using an alias domain (in cPanel) - configuring it so that the root of that domain is somewhere (where I want it) within the "main" domain's directory structure. And you have to make all the (navigation) links relative, not absolute.

    Note that it doesn't work with WordPress (or any other non-static website, that uses a database), of course - for it to work with WordPress, the "masked" domain needs to use the same root on the server directory as the "main" domain. Which beats the purpose I had intended - of showing simple, short URL-s.

    So, for now, it's choosing between links being convenient for the visitors, or content creation and maintenance (updates) being convenient for me, since having 2 copies of the same content (excluding backups of course) is bound to result in the contents being different (not all updated) over time. But it can work for websites that are static.

Sign In or Register to comment.