How do I resolve two domain names to one server?

I apologize if my question doesn’t make sense. I think that’s what I mean…

Basically, here’s my problem. I have www.oldname.net that I’ve used for the past three years and people interested in visiting my website would have this bookmarked. However, due to recent developments, I would like to get a new domain name (www.newname.net). I would like to host both domain names on the same server, and I would like them to resolve to the same place. So if somebody goes to the bookmark for oldname.net, they will automatically arrive at newname.net. Like the big businesses who own both “com” and “net” names and typing in one will automatically take you to the other.

Can anybody help me with this?

I just meant those URLs to be examples. I didn’t realize they would show up as real urls.

The easy way is just to make both domain names resolve to the same IP address. The specifics on how to do this is very heavily dependant on the configuration your hosting company uses. If they’re using host headers, for example, things get a bit more tricky.

You might have to call your hosting company on this one.

If you can directly edit your DNS records (most larger hosting companies don’t allow this, but you can sometimes call them and they’ll make the change for you), you can add what’s called a CNAME record in the zone file for oldname that points a visitor to newname. Be careful though, CNAME records can cause unexpected problems, esp. with email.

From ZoneEdit’s FAQ:

The other way is to do a 301 redirect from the old domain name to the new. If the OP cares about search engine rankings, I strongly recommend doing so via 301s. Search engines can be fickle. I redirect on my sites all requests of the type http://domain.com to http://www.domain.com because not doing that can cause problems with search engines. (For those unaware http://domain.com and http://www.domain.com technically are 2 different sites. They need not have the same content.)

I just noticed this part. If THAT is what you want, you MUST use the 301 redirect method.

I’ve heard of 301 directs, but I don’t know how to do it. My capabilities as a webmaster are extremely limited, I’m afraid.

Your best bet is to just ask your hosting company and/or look for info on their site. I run a small ISP and we have a Windows server and also run our own DNS. So what we’d require is for you to make sure both domains point to our nameserver, we have both in our DNS records, and we just pop a Host Header in there for domain.com and www.domain.com (domain.net and www.domain.net would already be up there for us.)

This is something our customers can’t do themselves, but we’re more than happy to do it for them when they ask.

Of course, Unix servers and other hosts will be different than us. But still - ask them.

Is your site on a host running a Unix box or a Windows box? I know little about Windows servers. What ZipperJJ has said indicates it would have to be done by the host. On a Unix server (most servers do run Unix), you would do this yourself by uploading to the old domain a .htacess file with the redirect code. If you are on a Unix box, I can get the proper code for you, and tell you how to do this.

I really don’t know. Fortunately for me, my server host is actually a friend of mine. I didn’t want to bother her if this was something I could do myself, but it looks like I’ll have to shoot her a quick email.

Thanks for the responses, everybody. I appreciate it.

If you care to post the URL of the old site, I can likely find out what the server is running by doing a server header check. You probably don’t have to e-mail the host to find this out.

www.pepperverse.net

Here are your server headers:

#1 Server Response: http://www.pepperverse.net
HTTP Status Code: HTTP/1.1 200 OK
Date: Thu, 24 Mar 2005 04:35:21 GMT
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_fastcgi/2.2.10 mod_jk/1.2.0 mod_perl/1.24_01 PHP/4.2.2 FrontPage/5.0.2 mod_ssl/2.8.12 OpenSSL/0.9.6b
Last-Modified: Mon, 20 Dec 2004 06:58:56 GMT
ETag: “4f49b6-19a-41c67830”
Accept-Ranges: bytes
Content-Length: 410
Connection: close
Content-Type: text/html

That site is on a Unix box, and thus you’ll have to upload a .htaccess file to root with the redirect code. To make sure I have the code right, I am going to ask people who know better than me to make sure. Watch this thread, and I’ll post the exact code and specific instructions on how to do this. It’s trivial. Just open any text editor, cut and paste the code, save it to a file named .htaccess, and upload that to root of the server.

Sounds good to me. Thank you :slight_smile:

Since it’s apache, then the server administrator can just add the following to the server configuration for your old site:


Redirect permanent / http://www.newname.net/

Apache will serve 301 (“permanent”) redirects for any request for your old site to the equivalent URI on your new site.