Forum Moderators: open
RedirectPermanent /hostname/virtual_path/site1/* [site1.com...]
RedirectPermanent /hostname/virtual_path/site2/* [site2.com...]
RedirectPermanent /hostname/virtual_path/site3/* [site3.com...]
Will it follow the following directives?RedirectPermanent /hostname/virtual_path/site1/* [site1.com...]
RedirectPermanent /hostname/virtual_path/site2/* [site2.com...]
RedirectPermanent /hostname/virtual_path/site3/* [site3.com...]
No and yes...
The directives above are invalid. Have another look at Apache mod_alias [httpd.apache.org]. The use of asterisks for wildcarding is not necessary when using Redirect or its variants such as RedirectPermanent. They use prefix-matching, not exact matching. Therefore, wildcarding is the default behaviour of these directives.
(Actually, in order to *not* do wildcarding, you must use RedirectMatch instead.)
The first of the following directives will redirect requests for /hostname/virtual_path/site1/<anything> to [site1.com...]
RedirectPermanent /hostname/virtual_path/site1/ http://www.site1.com/
RedirectPermanent /hostname/virtual_path/site2/ http://www.site2.com/
RedirectPermanent /hostname/virtual_path/site3/ http://www.site3.com/
The question, "Does Google honor wildcards in .htaccess exclusion directives?" Also has a yes and no answer: Google does not honor .htaccess. It cannot see .htaccess. It, like all user-agents, only sees the effects of your server processing .htaccess. In the case above, the server processes .htaccess, and returns a 301-Moved Permanently server response if any requested URI matches the URL-path of any of the RedirectPermanent directives. It is then up to the user-agent to extract the new URI from the 301 response header, and re-issue a request for the desired resource from the new URI. Yes, Google will do this when it deep-crawls.
There is on-going debate/discussion here on WebmasterWorld as to how to best accomplish relocations. The gist of it is that it will take some time, your page rank may suffer temporarily, and that a 301 redirect by itself is not the best solution. Speaking only for myself, I'd do it this way:
Jim
[my-host.com...]
[my-host.com...]
[my-host.com...]
As the directories start gaining search position I then licensed:
[my-directory-1.com...]
[my-directory-2.com...]
[my-directory-3.com...]
The problem is that Google is indexing files from both domains and penalizing my domains for DUPLICATE CONTENT. They are the SAME FILE. I only want Google to index the new domains and urls but NOT the virtual hosted urls. I also want the inbound links to the old virtual domains to point to the new domains.
I can't use a 301 handler because the files are in the same directory. No files have moved. Basically [my-host.com...] is NOW called [my-directory-X.com...]
I don't feel that I should be penalized by Google for this. THERE ARE NO DUPLICATE FILES. THEY ARE THE SAME FILE. GOOGLE JUST INSISTS ON CALLING THEM BY DIFFERENT NAMES. I HAVEN'T DONE ANYTHING but license a domain to replace formerly virtually hosted files.
Of course you can! And it's the only way to tell google what's going on!
>THERE ARE NO DUPLICATE FILES
As long as google gets the same files from my-host.com/my-directory-1/ and www.my-directory-1.com it IS duplicate content! Either 404 the old directory or 301 to the new location using absolute urls.
> I can't use a 301 handler because the files are in the same directory. No files have moved. Basically [my-host.com...] is NOW called [my-directory-X.com...]
You can still use the code above, just omit step 6 (don't delete the pages). Alternatively, you may be able to use RedirectMatch's back-reference capability to do it all with one directive:
RedirectPermanent /(my-directory-X)/(.*) http://www.$1.com/$2
Jim