You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by ra...@vex.net on 1996/11/18 01:48:20 UTC

Proxy patch - Attempt #2

Ik, here is a second attempt at the "host" -> "www.host.com" proxy rewrite.

This one sends a REDIRECT back to the client if and only if a request for
a single word URL comes in and that single word URL doesn't resolve.  It
also retains any path info.

ie.  http://cnn/      ->  http://www.cnn.com/
     http://vex/php/  ->  http://www.vex.com/php/
     http://vex.net/  ->  NO REWRITE

This matches the behaviour of Netscape Navigator.  IE doesn't do this, so
perhaps this feature should be disabled for IE clients.

*** proxy_http.c.old	Sun Nov 17 20:07:28 1996
--- proxy_http.c	Sun Nov 17 20:15:38 1996
***************
*** 176,180 ****
  	server.sin_port = htons(port);
  	err = proxy_host2addr(host, &server.sin_addr);
! 	if (err != NULL) return proxyerror(r, err); /* give up */
      }
  
--- 176,207 ----
  	server.sin_port = htons(port);
  	err = proxy_host2addr(host, &server.sin_addr);
! 	if (err != NULL) {
! 	        char try[HUGE_STRING_LEN];
! 		int l, changed=0;
! 
! 		if(strncmp(host,"www.",4))
! 		{
! 			strcpy(try,"http://www.");
! 			strcat(try,host);
! 			changed=1;
! 		} else
! 			strcpy(try,host);
! 
! 		l = strlen(host);
! 		if(l<=4 || strncmp(&host[l-4],".com",4)) {
! 			changed=1;
! 			strcat(try,".com");
! 			strcat(try,url);
! 		}
! 
! 		if(changed && !strchr(host,'.'))
! 		{
! 			r->status = 302;
! 			table_set(r->headers_out, "Location", try);
! 			send_http_header(r);
! 			return REDIRECT;
! 		}
! 		return proxyerror(r, err); /* give up */
! 	}
      }
  


Re: Proxy patch - Attempt #2

Posted by ra...@vex.net.
> I think it could be useful feature -- but only if it is configurable,
> perhaps even with a list of domains to search if .com fails.

Yes, that is what the current patch does.

> The last version I saw didn't appear provide the functionality described --
> but with that functionality, if it is required that the host have only one
> 'part' (ie. no periods, so it couldn't look like xxxx.yyyy), then there is
> no problem with adding new top-level domains (there should never be top
> level domains which are also specific sites).  Also, by the description and
> the code that I saw -- the extra domains will only be tried if the first
> attempt fails, no? 

Correct again.  

-Rasmus

Re: Proxy patch - Attempt #2

Posted by Ed Korthof <ed...@organic.com>.
On Nov 18, 10:40am, Brian Behlendorf wrote:
> Subject: Re: Proxy patch - Attempt #2
>
> My personal opinion is that it should at least be made a runtime configurable
> option in the proxy, or dropped altogether.  I think that kind of behavior
> prevents opening up of new top-level domains, as well as deprecating the use
of
> .net, .org, .edu, etc.  It's a regressive act in my opinion.
>
> 	Brian

I think it could be useful feature -- but only if it is configurable, perhaps
even with a list of domains to search if .com fails.

The last version I saw didn't appear provide the functionality described -- but
with that functionality, if it is required that the host have only one 'part'
(ie. no periods, so it couldn't look like xxxx.yyyy), then there is no problem
with adding new top-level domains (there should never be top level domains
which are also specific sites).  Also, by the description and the code that I
saw -- the extra domains will only be tried if the first attempt fails, no?

Ed Korthof
ed@organic.com

Re: Proxy patch - Attempt #2

Posted by ra...@mail1.bellglobal.com.
> My personal opinion is that it should at least be made a runtime
> configurable option in the proxy, or dropped altogether.  I think that
> kind of behavior prevents opening up of new top-level domains, as well as
> deprecating the use of .net, .org, .edu, etc.  It's a regressive act in my
> opinion. 

I am not so sure it is regressive.  It is analogous to a set of speed-dial
buttons on a phone.

However, I think whether we think the feature is good or not is not the
real issue.  The issue is whether or not the proxy should mimic the 
behaviour of client browsers.  In this case, moving Netscape users over to 
the Apache proxy will mean that the users have to change the way they 
access the web.  I am not a big fan of the feature either, but I am a fan 
of making the proxy as invisible as possible to the end user.

-Rasmus

Re: Proxy patch - Attempt #2

Posted by Brian Behlendorf <br...@organic.com>.
On Sun, 17 Nov 1996 rasmus@vex.net wrote:
> > Hasn't netscape stated they will be dropping this "feature"?  Or was
> > I just reading some root-64/alternic babble where they were *hoping*
> > the "feature" would be dropped so that their anarchistic attempt
> > to form new top-level domains would gain a hair more credibility than
> > it has now.
> 
> Microsoft had the feature at some point, but decided to drop it.
> I haven't read whether or not Netscape is planning on dropping it.
> I am not convinced either way whether it is a good feature or not.
> I don't think it is harmful or dangerous in any way though, and people
> have asked for it, so in the spirit of Apache, I thought it would be a
> user-friendly thing to add.  If that's not the concensus, no problem.
> We can drop it.

My personal opinion is that it should at least be made a runtime configurable
option in the proxy, or dropped altogether.  I think that kind of behavior
prevents opening up of new top-level domains, as well as deprecating the use of
.net, .org, .edu, etc.  It's a regressive act in my opinion.

	Brian

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com  www.apache.org  hyperreal.com  http://www.organic.com/JOBS


Re: Proxy patch - Attempt #2

Posted by ra...@vex.net.
> Hasn't netscape stated they will be dropping this "feature"?  Or was
> I just reading some root-64/alternic babble where they were *hoping*
> the "feature" would be dropped so that their anarchistic attempt
> to form new top-level domains would gain a hair more credibility than
> it has now.

Microsoft had the feature at some point, but decided to drop it.
I haven't read whether or not Netscape is planning on dropping it.
I am not convinced either way whether it is a good feature or not.
I don't think it is harmful or dangerous in any way though, and people
have asked for it, so in the spirit of Apache, I thought it would be a
user-friendly thing to add.  If that's not the concensus, no problem.
We can drop it.

-Rasmus

Re: Proxy patch - Attempt #2

Posted by Dean Gaudet <dg...@hotwired.com>.
In article <ho...@krone.house.mil>,
 <ra...@vex.net> wrote:
>Ik, here is a second attempt at the "host" -> "www.host.com" proxy rewrite.

Hasn't netscape stated they will be dropping this "feature"?  Or was
I just reading some root-64/alternic babble where they were *hoping*
the "feature" would be dropped so that their anarchistic attempt
to form new top-level domains would gain a hair more credibility than
it has now.

Dean