Forum Moderators: open
I have one hosted site with 4 domains all pointed at my hosted site. In the main directory I have a PHP page that reads the requested domain name and does a relative redirect to a subdirectory appropriate for that domain name. I have 4 subdirectories, each one housing content to a particular domain. Each domain is really an unrelated site.
This way I can have 4 sites with their own content and domain names, but just one hosting account.
This all works fine.
But how will Google treat it?
Thanks.
Welcome to WebmasterWorld!
This depends on the details of how the redirect is accomplished.
If it was me, I'd use server redirects, such as URL rewriting in .htaccess (on Apache Server) to accomplish what you need to do.
If you are using PHP to create html pages containing <meta refresh> redirects or JavaScript redirects, you could have problems with search engines not following the redirects properly, and therefore seeing the redirect pages as duplicate pages with very little content.
I'm no php expert, but maybe this will give your question a bump, too.
Jim
In using PHP I am doing the redirect at the server level, not a META Tag or a JavaScript. PHP will allow me to send a 301 or 302 HTTP header. Like a Response.Redirect in ASP, it sends raw HTTP header.
From reading a bunch of other posts today it seems to be pretty certain that I should at least use 301 (Moved Permanately) but it seems pretty up in the air whether redirects are good, and I couldn't really find much about sub-directories.
Thanks for any more tips,
John Peterson
I don't really think search engines care about your directory structure, as long as it is relatively straightforward and simple to spider.
The same thing goes for subdomains - just keep it simple, don't duplicate content, and you'll likely be OK.
If the user is typing in four different domain names and landing in your php script, then that script can just do a "silent" internal redirect and serve the requested page from the requested "domain" or "subdomain" (really a subdirectory) without doing an external 301 or 302 redirect. In other words, just translate the requested URL into a correct file path, and serve it.
This should work if what you have is 4 domain names pointed to one IP address, and then a script to sort out which files to serve based on the requested URL... I think that's what you are describing.
* I don't think that would be a problem * But I could be wrong, so...
All,
I'm not completely sure I understand the question, so before jocko takes my advice and runs with it, can we get a second opinion here? :)
Jim
I think you've described the situation pretty well here Jim.
It is unfortunate that the wording 'internal redirect' became popular. It becomes confusing when some "redirects" actually 'redirect' the browser and other "redirects" do not 'redirect' the browser.
If the content has moved (change of URL) then an external redirect is best (301 in mod_rewrite Redirect or RewriteRule, ASP response.redirect or PHP Header'("Location: '); or just a (very quick loading) page with a big link in the middle.
For delivering different content from the same URL path (the stuff after the first "/"), but a different host, then you just need to rewrite the content internally. How to do this depends on the software, but if it's purely internal then Google will just get what the browser gets so there's no problem.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META NAME="GOOGLEBOT" CONTENT="NOINDEX, NOFOLLOW">
<META HTTP-EQUIV="Refresh" Content="0;URL=http://www.widget.com/">
</head>
<BODY>
<FONT SIZE="6" COLOR="red"><CENTER>We have moved to <A HREF="http://www.widget.com/">www.widget.com</A>. </CENTER></FONT>
</BODY>
</HTML>
*****************************************************************
In addition I sent up a robots text as follows:-
User-agent: *
Disallow: /
*******************************************************************
Are these correctly done? Will Googlebot see these as genuine and not some attempt at "doorway" page?
Under the circumstances I don't know what other action I can take.
BTW I did a meta-refresh for ALL the pages of one site which I wanted moved to my main domain.
Appreciate your comments.