Forum Moderators: phranque

Message Too Old, No Replies

Question about virtual host and Google indexing

         

manouche

7:40 pm on Oct 31, 2008 (gmt 0)

10+ Year Member



I have a site that has a virtual host specified in the httpd.conf file for Apache. For this example, the name of the site is mydomain.com. The address for the site that uses the virtual host is myvirtualdomain.org. This works fine using the entry below. However, I can't get Google to index the myvirtualdomain.org site. I added the redirect line as shown below and tinkered a bit with url rewriting, to no avail.

Can someone enlighten me as to what might preventing Google from indexing this so that a search for the name of the website represented by the top level myvirtualdomain.org page will come up with a result.

The entry for the virtual host is like this:

<VirtualHost *:80>
DocumentRoot /www/home/mydirectory
ServerName myvirtualdomain.org
ServerAlias www.myvirtualdomain.org
Redirect 301 [mydomain.com...] [myvirtualdomain.org...]
</VirtualHost>

g1smd

8:15 pm on Oct 31, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The left side of the redirect should only include the path, not the domain name.

Your redirect doesn't work for requests to /home/mydirectory/ though - and it should work for those.

I would use a RewriteRule with R=301 and redirect all requests both with and without the index filename included.

manouche

5:48 pm on Nov 3, 2008 (gmt 0)

10+ Year Member



Thanks for your reply. Do you think this will work?

RewriteEngine On
RewriteRule ^/home/mydirectory/(.*)$ [myvirtualdomain.org...] [r=301,L]

Shouldn't one of the results of doing a URL Rewrite be that in the browser address location bar, when I enter
[mydomain...] it should result in [myvirtualdomain.org...] ? It does go to the right page, but the URL does not show as being rewritten. Am I missing something?