Mobile app version of vmapp.org
Login or Join
Alves908

: Changing web host: want to change domain name, but want to forward users to new domain I'm moving to a new web host, so totally new IP. At the same time, I want to change my domain name

@Alves908

Posted in: #Dns #Domains

I'm moving to a new web host, so totally new IP. At the same time, I want to change my domain name from xyz.org to xyz.net (it's a non profit website that several hundred people use, but there's no organization. It's just me, so the '.org' is a bit of a misnomer). If people continue to go to xyz.org, I'd like them to be automatically redirected to xyz.net. Also, I'd like a way to detect, via server-side php or javascript in the client browser, that they've been forwarded and put up a message like 'Yo dude, start using the new URL: xyz.net'

I'd prefer to do all this while not having to pay to the original webhost to keep my xyz.org site running so it can forward users using traditional http forwarding methods. So can this forwarding be done any other way? Can a DNS registry service do this forwarding for me? Suggestions?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Alves908

1 Comments

Sorted by latest first Latest Oldest Best

 

@Hamaas447

This is all quite straight forward.


Register your new domain and get the site going at the new host.
Add the old domain to the DNS on your new host.
Change the nameservers on the old domain to your new host
At your new host add a redirect from the old domain to the new domain


There are numerous ways of detecting that the visitor has come via the old domain. Coding is off topic on this site, but if it were me, I would redirect the old domain to xyz.net?redirect=true (or whatever suits you) and then on the new site using PHP parse the querystring and act accordingly.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme