Changing domain names

is it possible to change the domain name of a hosting package?

basically: I set up the site under domain1.com but Ive now been asked to change the domain name to domain2.com.

I parked domain2.com and now you can access the site via both domain names which is fine but any relative urls within the site still show as domain1.com/whatever… so after a couple of clicks the address bar is back to displaying domain2.com

is there a way where I can get domain2.com to show in the address bar and relative urls instead?

Ive never done this before so I’ll need to read up on it. Will this work for dynamic query strings?

do you happen to have a link to a good tutorial for doing this?

thanks

as I said, his post was highly confusing, why would he asked:

is it possible to change the domain name of a hosting package?

if domain2 is already there? so, yes I assumed he acquired domain2 at a registrar and parked it there - okay the ad server was wrong, but it’s still the same, isn’t it?

Incorrect. You are thinking of domains parked on an ad service, not domains parked on your own hosting.

A parked domain displays exactly the same content as the domain it is parked on since both domains point to the same folder.

The solution to getting domain2 to be the one displayed is to update the .htaccess file in the folder to do a 301 redirect from domain1 to domain2.

a bit confusing…

  • is your domain2 now parked or is it not? parked domains are registered domains but you don’t have any of your own content on it, it only displays a bunch of related ads.
  • if you’re indeed using relative URLs, then when you’re on domain2, you should stay on domain2, no matter what. Relative URLs are /services/service1.html as opposed to absolute URLs, which are http://www.domain1.com/services.service1.html

Basically, you should be able to point both domain names to the same location on the same server. But you should also do a 301 redirect from non-preferred domain to preferred domain name.