20i Domains

Some advice really appreciated

Discussion in 'General Board' started by domainseller200, May 10, 2022.

  1. domainseller200 United Kingdom

    domainseller200 Well-Known Member

    Joined:
    Jun 2007
    Posts:
    3,369
    Likes Received:
    128
    Long time no post, been a long while since I made a post on here (I only just realised I joined this forum 15 years ago next month too :eek:) but I do lurk from time to time and it’s good to see some of the old timers still active.

    I am looking for some idiot proof advice on wildcard domains and an idiots guide explaining to me how to achieve the following.

    Basically I have a domain name registered at 123-reg with my nameservers pointing to Fasthosts hosting (that’s where my site is hosted)

    Can someone please explain to me how to achieve a ‘catch all traffic’ for anyone visiting a web address which doesn’t exist, and for that visitor to be redirected to the main homepage for anything that is typed in the form of a sub domain.

    eg If xxxxxx.mydomain.co.uk or anything was typed which didn’t exist, the visitor would be sent to the home page of mydomain.co.uk

    I have read about wildcard domains and setting up a dns entry with an A type entry of * and pointing that to an IP address, however everything I have tried doesn’t work.

    Any advice on this would be truly appreciated as it is driving me mad, and I’m unsure if it’s an actual issue between having the domain registered one place and hosted at another place, or if I am doing something wrong.

    Thank you :)
     
  2. Domain Forum

    Acorn Domains Elite Member

    Joined:
    1999
    Messages:
    Many
    Likes Received:
    Lots
    articles.co.uk
     
  3. m4c United Kingdom

    m4c Active Member

    Joined:
    Jan 2010
    Posts:
    98
    Likes Received:
    10
    Don’t have experience of doing that - but I would take a look at cloudflare - you might be able to achieve that with a free account…
     
  4. ELIFE-MZ

    ELIFE-MZ Active Member

    Joined:
    Feb 2005
    Posts:
    524
    Likes Received:
    27
    Hi Frank

    I might be talking out of my backside but I think it's probably not possible on places like Fasthosts unless you have a dedicated server. With shared IPs you would need to list all catchall instances as host headers. I have done something similar using own DNS service and dedicated server. You can then use htaccess or equivalent to redirect to main homepage.

    I hope it helps ..
     
  5. webber

    webber Active Member

    Joined:
    Sep 2019
    Posts:
    627
    Likes Received:
    166
    You've already solved half of the problem – the DNS side.
    If your DNS manager allows you to use wildcard (not all do) then that will catch all subdomains.
    The seconds half of that problem is to point them to server IP that knows what to do with that and, as Mo suggested, you won't be able to do that on a shared hosting account. You would need to have control over the default vhost of that server/vps.
    I haven't tried this myself but you might be able to use a CNAME record instead of an A record,so have:
    *.example.co.uk 86400 CNAME example.co.uk
    If that works you would need to deploy some .htaccess redirects
     
    • Like Like x 1