Forum Moderators: coopster
To make it more obvious, I resolve all my domain names to one ip address. From the index.php file that is default for that ip, I re-rout the client to a specific directory based on what domain name they entered to get there.
switch ($_SERVER['HTTP_HOST']) {
//----------------------------------------------------------------------------------------------------
case "www.somedomain.net" :
header("Location: ["...] . $_SERVER['HTTP_HOST'] . "/hf/pp/index.php");
break;
//----------------------------------------------------------------------------------------------------
case "www.anotherdomain.org":
header("Location: ["...] . $_SERVER['HTTP_HOST'] . "/hc/pp/index.php");
break;
//----------------------------------------------------------------------------------------------------
case "www.yetanother.net":
header("Location: ["...] . $_SERVER['HTTP_HOST'] . "/pe/pp/index.php");
break;
Also, if you have access to your httpd.conf, couldn't you put those domains in VirtualHosts to give them their own roots?
The redirect you're using does not appear to alter the domain name in any way, so it is OK. (feel free to disagree with cause)
The only thing I see happening here is a redeirect from http://www.somedomain.net/ to http://www.somedomain.net/hf/pp/index.php which is perfectly fine, no problem, what so ever.
Now, if you were typing in http://www.yetanother.net/ into your browser and being redirected to http://www.somedomain.net/pe/pp/index.php, that would be different. But as I can see it, you are not.
The secondary domains appear to be transparent to the user, with no trace of the other domains in the url or the redirect.
Congratulations, you're doing virtual hosting, probably in your virtual hosting account!
you want to avoid redirects on your home page like the plague if search engine rankings are of concern.
There is nothing wrong with a redirect as long as you are sure which one you are using(301 vs 302) and know what it's affects are. header("Location: #*$!") sends 302 by default, and that's probably ok.
302 means yeah, the page you requested is valid, but get it's contents from here. 301 says the page you requested is officially now at a new location, so you should ask for it from there from now on. (paraphrased)
Regarding my VirtualHost suggestion, you've again leapt to invalid conclusions. VirtualHosts are simply a way of hosting multiple domains on a server. They are especially useful when your servers have limited IPs because they allow multiple domains to use the same IP.
The w3c is clear about what 'should' be the case, and 301 and 302 redirects are transparent to the user except for the change in the browser address bar; but of course, SE's do not necessarily follow the w3c's recommendations when it comes to browser behavior - in general I wouldn't worry too much about a 301 redirect, since they are known to 'move' pagerank and other page information along to the new page - but your front page is usually mission critical in terms of distributing page rank. Slade, have you seen instances of redirects from the home page which maintained PR / positions compared to just having home page in webroot? You obviously have different info from mine, maybe more up-to-date. Must admit, I'm still with Salsa here. (actually, posting this question in 'search engine promotion' or one of the SE forums might get you a better answer). I'd also use the mod_rewrite approach like he suggests if I had to try something like this.
Original Poster: My question is do search engine spider/cralwers have problems with this
No, they will not have issues with your redirects, see links below:
[webmasterworld.com...]
[webmasterworld.com...]
[webmasterworld.com...]
[webmasterworld.com...]
or do they see the domains as "separate".
Yes, they will see the domains as seperate, as long as there will never be a redirect that crosses domain names.
Those, were the questions...
Salsa:No, in this case returning a 301 or 302 is not a good solution. They are alerts that you've done a redirect, so what you are suggesting is not transparent to crawlers, which is the issue.
I'm not quite sure why you're afraid of 30x redirects. The redirect will be entirely within the domain the request appears in, which is ok, see my links above.
Regarding my VirtualHost suggestion, you've again leapt to invalid conclusions. VirtualHosts are simply a way of hosting multiple domains on a server. They are especially useful when your servers have limited IPs because they allow multiple domains to use the same IP.
I did not even see your comment on virtualhost's at the time. I was referring to using the HTTP_HOST variable to determine which site's content to display, which is essentially what virtualhost'ing is.
mincklerstraat: you want to avoid redirects on your home page like the plague if search engine rankings are of concern.
Again, I don't know why yall are so afraid of redirects. I have seen some things in the last few months with 302's and links from other site's, but that's not what we're talking about, and actually would work just fine for the situation he's describing.
If you want to provide the same function without using the redirects, you can test for the host name in .htaccess and redirect it in there.
[edited by: coopster at 2:05 am (utc) on Nov. 19, 2004]
[edit reason] fixed quote tag [/edit]
I'd still be very reluctant about home page redirects - often 'old' SEO advice doesn't get irrelevant, it's just not discussed anymore since it's assumed 'everybody knows already'. Before I'd employ home-page redirects, I'd also want to see people I knew better on the SEO forum state that this is no longer a problem - what has changed from the situation previously, or some statistics from a recent case. Even 'senior members' are fallible. Unfortunately, searching the site for 'homepage' and 'redirect' brings up so much stuff it's hard to find recent threads on the matter. I know my hits went way up when I got rid of my redirect - problem is, that was 2 years ago. I still, though, couldn't point a single well-ranking site that uses a redirect at the home page level - you might be able to provide me with one.
Redirects are still 'exception handling' behavior, no matter how useful and frequently used. SE's change their algos, everybody goes nuts trying to find out what the new 'rules of ranking' are. It's entirely possible that a SE that today shifts the pagerank from example.com (heavy in pagerank; all links point to this page) to example.com/this/page.htm because of a properly-done redirect, tomorrow will have some other algo handling redirects in general (since redirects are so commonly used by spammers, this is quite likely actually).
Like you suggest, though, the mod_rewrite option would be transparent to search engines as well, and in my opinion a better way to be sure about things.
And another note to benlieb: however you go about this, make sure that a spider in domaina.com can't accidently spider the pages which are supposed to be in domainb.com - you could check this with the $_SERVER['HOST'], perhaps.