Using DNS to Point a Domain to a Specific Page? - dns

I know this question seems pretty straight-forward, but I'm having a hard time pulling up any answers on Google / Other Forums.
A client has a few domains parked on Network Solutions - not attached to any hosting account. I'm planning to point one of the recently purchased domains to a sub-directory of our main site (hosted elsewhere) - as part of a special promotion that's running.
However, Network Solutions now charges for Web Forwarding. In hopes of avoiding an additional charge I thought I'd use the DNS settings to point the IP to the site - but that just takes the user to the main website's home-page --- and not the specific sub-directory I need it to.
Since the domains are just parked - and not associated with a hosting account, I don't have access to a .htaccess file to deal with 301 forwarding or anything there.
Any ideas? Thanks in advance!

Just point the DNS to your server and set up vhosts for each of the new domains. Then, drop in a one-line JS or PHP index file (or mod_rewrite rule) to redirect to the desired page on your main site.

Related

How can I point multiple domain names to the same GitHub Pages site?

This seems like it should be a trivial task but isn't proving to be one for me...
How should I go about pointing multiple domain names to the same GitHub Pages hosted site?
Example:
I have created an account named test on GitHub and created a repository test.github.io
I bought test.com
I configured test.com's DNS as below
I have told GitHub Pages to enforce https and look out for custom domain test.com
My site is now live on test.com and www.test.com, woohoo!
DNS Config for test.com:
A # 185.199.108.153 (github's nameserver)
A # 185.199.109.153 (github's nameserver)
A # 185.199.110.153 (github's nameserver)
A # 185.199.111.153 (github's nameserver)
CNAME # www.test.github.io (for www redirect)
I would ALSO like example.com (and a few other domains, foo.com, bar.com and foobar.com) to redirect to test.com
How do I do this?
With an apache server, this would be easy, be GitHub Pages only supports static sites.
Any ideas?
As always, thanks for any suggestions!
The ideal place to have this redirect is your DNS provider. You can redirect foo.com, bar.com, etc. or whatever you want to test.com. Alternatively, if you happen to use Cloud Flare, forwarding can easily be setup from there too.
But if you don't want to do that and insist on using Github only, refer to this answer. What you can do in this case is create another repository (other than test.github.io) with same contents and link it to another domain such as foo.com. You can use Github Actions or something to sync your changes from main repo to the others.
Of course, the only drawback of this method is that for every domain you want to link, you'll have to create an additional github repo.
I've accepted #Prahlad Yeri's answer from above, and am just leaving this here so that other's who stumble onto this question can easily figure out how to do this... As mentioned "The ideal place to have this redirect is your DNS provider"
To do this with domains purchased from domain dot com it is VERY simple, and even INSTANTANEOUS! I can imagine with GoDaddy or other providers it will be similar.
On Domain dot com's control panel:
Log into account for the domain you wish to redirect
Go to "Pointers and Subdomains" on the left sidebar
Choose either "URL Standard" or "URL Stealth" from the pointer options, then enter the desired redirect URL in the "Directory" field
Press Save and you're good to go, immediately!
URL Stealth means that your URL will remain as what the user has typed in, and URL standard means it will display the URL of the site that you've directed to. More documentation on pointers and subdomains (for domain dot com) can be found at domain.com/help/article/domain-management-how-to-update-domain-pointers

Replacing main domain server impact on add-on domains and websites

I'm working on a website that has multple websites installed (via same CMS) and used as international websites.
The server at the moment is connected with a main domain www.example.com. International installs are folders in its public_html. They are pretty independent of each other.
Now the international domains like example.co.uk are actually defined as add-on domains that redirect to public_html/uk folder (which has its own htaccess, and again its CMS installation; files and db).
My question is what would happen if I point www.example.com to another server? what would happen if someone tries to access example.co.uk?
Ideally I'd like that public_html/uk folder to be connected with the domain example.co.uk but yeah setting the DNS to a folder is not possible.
Thanks everyone.
If you point your example.com to another server, this domain obviously would display content from the new server instead.
If you've set the home/root directory for example.co.uk as public_html/uk (which you probably have done), this domain will serve that folder as expected and changing the main domain would not affect this.

Point sub domain to root AND redirect main domain

I have
'website.com' and 'newwebsite.com', both on LAMP environment.
I need
website.com redirecting to newwebsite.com
AND
old.website.com pointing to root of website.com
I have full control of both hosting and DNS records.
I can't figure out the best solution without creating a loop !
There are two choices here: redirects, or DNS records. If you do it with redirects it means the user will see that they have been forwarded elsewhere. If you use DNS, the user will not be aware of the deprecation of the old websites.
For this reason, I would use HTTP redirects for this task.
If you wanted to go the DNS route then simply have an A record for newwebsite.com and CNAMES for the others that point to it.

301 Redirect without hosting

I have a client who is merging two sites into one. For the time being we are just installing a WP plugin to the site to manage the handful of 301 redirects they'd like handled, rather than writing to .htaccess manually.
But in a month or two they'd like to remove the site completely. Is there a way we can redirect traffic to the new combined site once they get rid of their hosting and we no longer have access to their .htaccess?
I have seen some brief mentions of setting the DNS to something but I don't totally understand and I'm not sure if this is the right thing to do. I have not asked the client if they are holding onto the domain name. In order to point the DNS to the new site, we'd need them to still own the old domain, correct? What would I assign the values to be?
You have to own the domain to do anything with it including updating DNS name. It wouldn't be smart to let it go.
If they don't have hosting on it anymore, then they will need to do domain forwarding with DNS. It can be done with 301 or 302 status codes. This link will show you how to do it on Godaddy. If you don't have Godaddy as your registrar, just look for the instructions for your domain registar.
https://www.godaddy.com/help/manually-forwarding-or-masking-your-domain-name-422

Domain name point to subdomain of a entire different domain

I am completely confused the last few days with this and I still haven't found an outcome that's worked.
Basically I have a domain name without hosting at letshost.ie which is dublinplasterer.ie
I also Have one domain & hosting with godaddy for domain- shanafagan.com which is my own site for web/graphic design service.
I created a subdomain= dublinplasterer.shanafagan.com and uploaded the site files.
Basically I want for example when someone types in dublinplasterer.ie in the address bar if goes to dublinplasterer.shanafagan.com but doesn't show dublinplasterer.shanafagan.com url, stays as dublinplasterer.ie
Im not even sure if this can be done at this stage. head is melted
shanafagan.com and the subdomain dublinplasterer.shanafagan.com have the same ip so how will that work if changing dns?
Any help would be greatly appreciated , am so stuck at this stage.
If you wanted to do it this way you would need a web server for domain2.com
Search for ProxyPass.
The way you should do this is add a second domain on your web hosting (cpanel for example) and point the other domain to this web server.
If you are struggling I recommend using a solution like cPanel that is widely used and simplifies much of the process. It is common enough you can google most issues.
So normally you would have started by making an add-on domain (instead of a subdomain) which would also create it's own subdomain anyway. To do that, you go to your cPanel in GoDaddy and find add-on domain, then make it "dublinplasterer.ie" (Don't add www. to it. Even though this name is hosted elsewhere, we will later go to your DNS files at that hosting and point it to your GoDaddy's name servers and this add-on helps it direct to the right root folder) then choose your local root folder for that site (I think you can actually make this the same as your other subfolder already hosting your files and then it will just pull the same site) or you can pick a different subfolder and then make the add-on domain. This tells any request to this name server that if it is a request for "dublinplasterer.ie" it needs to send it to the subfolder you specified.
If you don't make the subfolder the same as the one you already made, you can either load the same content into your new subfolder or create a CNAME record telling this add-on to point to your subfolder instead but that is more complex so go with the other route.
Lastly, you need to go to your original hosting at letshost.ie and under your domain name find the DNS records tab. Change the name servers to match your GoDaddy ones and now (may take a day or two to show as DNS changes often take days and can't be seen immediately but you can try using a different device/computer/mobile that hasn't loaded it previously to see if it will refresh the correct dns) it should work. Even though it points to your main site name servers, the add-on domain you made receives it and directs it to the subfolder you specified on the add-on domain.
Hope that helps, let me know if it works for you.

Resources