Forum Moderators: phranque

Message Too Old, No Replies

Virtual Server Problem

2 URLs per page: URL and actual server address

         

cialia

5:58 pm on Feb 21, 2003 (gmt 0)

10+ Year Member



I'm sorry if this has been answered elsewhere already - I've been unable to find help on this topic for the past 2 hours and it's driving me nuts!

We have a few virtual servers set up on one webserver (RedHat/Apache). Google Results for "Jonglei Bucket" display both the virtual domain URL (the one we want) and the physical domain:

1. geography.ou.edu/courses/1103bw/16-reactions.htm
2. geowww.gcn.ou.edu/~geog/courses/1103bw/16-reactions.htm

Does anyone know of a way to restrict the searching to only the virtual server addresses? I don't think a robots file will work and I can't find information on this anywhere! Thanks in advance.

(Similar results on Yahoo and Inktomi searches.)

Alicia

NickCoons

6:04 pm on Feb 21, 2003 (gmt 0)

10+ Year Member



cialia,

If Google is showing both, it's because someone is linking to both, and Google has found and crawled those links.

You could setup something that detects the requested URI, then 301 redirects to virtually-served site if the other is requested. Google should follow this redirect and eventually drop the other link from their index.

Marcia

6:36 pm on Feb 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld, Alicia. You'll benefit a lot by going through this terrific tutorial on redirection:

An Introduction to Redirecting URLs on an Apache Server
[webmasterworld.com]

You'll find it very helpful for understanding the basics.

DaveAtIFG

7:45 pm on Feb 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi cialia

The following code in a .htaccess file will send all requests that are not somedomain.com to www.somedomain.com and return a 301 response.


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

It's not exactly what you need but it's close. After you finish the Intro suggested by Marcia, you should be able to revise it meet to your needs. And our regulars are usually happy to help you learn if you get stuck.

Welcome! :)

cialia

8:44 pm on Feb 21, 2003 (gmt 0)

10+ Year Member



Thank you all so much! I will give these a try.
-Alicia

jdMorgan

8:55 pm on Feb 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Corrected missing space preceding "!" and removed end anchor from RewriteCond pattern which can cause problems if port number is present.

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

Jim

DaveAtIFG

9:45 pm on Feb 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Jim! ;)