Forum Moderators: phranque

Message Too Old, No Replies

Server Woes

         

jfred1979

3:31 am on May 27, 2003 (gmt 0)

10+ Year Member



Although I've been developing web sites for a while, I've never really had to do anything server side, other than call on a few canned cgi scripts. I now have a client that needs several domain names to point to a site and I'm realizing I know nothing about configuring a server to do this, or anything else for that matter. I've been told to add the domains to the "host header" and seen lots of talk of "permenant redirects" but these mean nothing to me. I'd really like to know how to do some basic things without having to learning all the ins and outs of Apache. Will I need to use telnet access to do these things? If so, anyone know where there's a basic tutorial on using the Windows telnet program? Any info or links to resources for a "server beginner" like me would be helpful....

jdMorgan

3:41 am on May 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



jfred1979,

If you go into IE Options->Advanced, and set "Enable Folder view for FTP Sites," you can use plain old Internet Explorer to move files to and from the server. Just type the ftp://yoursite.com address into the address bar, and it will prompt for username and password. There are really very few things you might need to do that will require using Telnet.

For a basic redirection primer, try this, and follow the links: Introduction to mod_rewrite [webmasterworld.com]

HTH,
Jim

txbakers

3:42 am on May 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi.

First question: is the webhost using Windows or *nix?

It sounds like you know that the webhost is already using Apache and not IIS.

jfred1979

12:00 am on May 28, 2003 (gmt 0)

10+ Year Member



Thanks for the link on redirects, very helpful... BUT.... I still don't really understand why I need a redirect to point multiple domain names at a site. I guess I don't understand the whole relationship between a server and a domain name. I know each server has a unique IP address and the domain name needs to be "translated" that IP address (which I think is done by a DNS), but I'm not completely clear on how this is done and how the whole redirect thing fits into this. Sorry for the simple questions, but I can't find anywhere that spells this out.

And txbakers, the host I'm using is running Apache....

jdMorgan

12:42 am on May 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



jfred1979,

The steps you need to take in logical order are:

  1. Check with your site hosting company to make sure that it is OK to point multiple domains to your server account.

  2. "Point" the new domain names to the same IP address (I assume it's the same because of your stated requirements) by adding "A Records" to your DNS server entries. You may have to ask the company that runs your DNS servers (probably the company that hosts your site) to do this, or maybe you can do it yourself from your "account control panel."

  3. On your server, redirect all alternate* domain names to your main domain name using 301-Moved Permanently, unless the sites will have unique content. Alternately, you can transparently redirect each domain name to a subdirectory of your hosted account if they do have unique content. This is all done with server redirects.

The above steps actually need to be rearranged, with the first and third steps occurring first to lay all the groundwork for the second step - it just made more sense to me to decribe them from "top to bottom" in the 'net heirarchy.

The purpose to all of this is to avoid duplicate-content problems. You don't want to have multiple domains all containing the same content, unless you want to run the risk of having all but one domain (and you don't get to pick which) dropped from the search engines or - possibly - having them all penalized. Basically, search engines take a very dim view of attempts to get multiple listings in their search results which all lead to the same content. It is considered to be "clutter," and rightly so.

* In order to redirect the alternate domain names to the main domain name, or to "sort out" the various domain names into their own directories on the server, you will need to check the HTTP_HOST header in the incoming request. There are several examples of doing these things using Apache mod_rewrite floating around here on the forums; it is not at all difficult, once the desired result is well-defined.

---

I have no idea how all this fits in with your plans, I'm just throwing it all out for your consideration.

My opinion is that the safest approach is to promote (advertise, solicit links to) only one domain and use the other domains only for "branding" and catching very-common misspells and typos, redirecting them all to the "real" domain. Others more skilled in the 'black arts' may disagree.

HTH,
Jim

jfred1979

12:37 pm on May 28, 2003 (gmt 0)

10+ Year Member



Thanks, this is very helpful. One thing that I don't understand is this: when I point the domain names to the new IP address won't they all just point to my index file in the root directory? Can I specify which file specifically they point to (in this case the redirect pages)?

I'd rather not have the SEs pick up all the domain names, just the main branding name. If all the redirect pages are in the root directory will they be picked up? What about making separate directory for the redirect pages and then adding a robot.txt file that tells SEs not to go there?

jdMorgan

4:27 pm on May 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



jfred1979,

> Can I specify which file specifically they point to (in this case the redirect pages)?

No, and yes... and you don't need redirect pages, all you need is a tiny bit of server code.

The DNS record will point all domains to one IP address/hosting account. Once the browser/robot arrives there, you can detect which domain it requested, and use server directives or scripts to "sort it all out" and deliver whatever content you want. If you don't want the alternate domain names to be used in search engine listings, then you would implement a 301-Moved Permanently redirect from the alternate domains to the main domain.

This is easily implemented on Apache by placing the following code in a file named ".htaccess" in the web root (homepage-level) directory:


Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.maindomainname\.com
RewriteRule ^(.*)$ http://www.maindomainname.com/$1 [R=301,L]

That is straight off of one of my working servers, with just a bit of simplification. The links in the "Introduction" thread I cited above will lead to the information necessary to understand this code, but it basically says, "If the requested domain is not our main domain name, then 301-redirect the requestor to our main domain name, and have it re-request the same page from that domain."

This may be confusing, but remember that domain names and URLs are not "real" - They are simply conventions... means to an end. The only things that are real are the link that a user clicks on (or that robot follows), and the CONTENT that the user or robot desires. In the simplest cases, that content is in a file. So everything between the link and the content is just step-wise translation of the request to a filename. Therefore, you can have multiple domains pointing to the same filespace, and multiple subdirectories in that filespace supporting those multiple domains. Or you can deliver the same content for each domain requested (which can cause duplicate content problems). Or you can have the server tell the browser or robot, "That content has moved, use this domain name {your main domain name} from now on" by using a 301-Moved Permanently redirect, and therefore avoid the dup content problem.

HTH,
Jim