Вы находитесь на странице: 1из 2

Ralf Engelschall’s original email to Apache Developer’s List (annotated)

1 From rse Wed Nov 19 15:47:27 1997


2 Subject: Re: virtual domains using mod_rewrite
3 To: new-httpd@apache.org
4 Date: Wed, 19 Nov 1997 15:47:27 +0100 (MET)
5 From: rse@engelschall.com (Ralf S. Engelschall)
6 Organization: Engelschall, Germany.
7 Reply-To: rse@engelschall.com
8 X-Home: http://www.engelschall.com/
9 X-Mailer: ELM [version 2.4ME+ PL32 (25)]
10 MIME-Version: 1.0
11 Content-Type: text/plain; charset=US-ASCII
12 Content-Transfer-Encoding: 7bit
13 Status: RO
14 Content-Length: 4168
15 Lines: 79
16
17
18 In article <Pine.BSF.3.95q.971118164110.10146D-100000@valis.worldgate.com> you
19 wrote:
20
21 > Has anyone done any work on trying to make something like the below work
22 > completely? This would be very cool to be able to do fully. Then you can
23 > implement a hostname for each user without using virtualhosts. Hey, you
24 > can even use only one IP. marcs.wild.znep.com == alive.znep.com/~marcs,
25 > ann.wild.znep.com == alive.znep.com/~ann, etc. Only one A record needed
26 > for all of them. No mess, no changes required when you add users.
27
28 > Problems with the example given include that .htaccess files aren't being
29 > read properly, logs aren't always as expected, redirects (eg. directory
30 > requests without a trailing '/') don't give the correct hostname.
31
32 > Some are probably fixable without code changes. Others may be more
33 > difficult.
34
35 > Anyone else think this is really cool?
36
37 Yes, it's a cool idea ;_) But I have to say that I only created the idea as an
38 example for mod_rewrite but never used it myself... But it's worth to think
39 about it in depth.. Hmmm...
40
41 > Oh, Ralph, I think a lot of mod_rewrite docs from www.engelschall.com
42 > would be very useful included in mod_rewrite docs in the distribution.
43
44 Yes, I know. This point is still on my todo-list, but I'm not sure how I
45 should include it. At least the practical solutions should become a
46 htdocs/manual/misc/rewrite_solutions.html. No problem from myside according to
47 copyrights, etc. pp. The only problem is that this page...
48
49 > From
50 http://www.engelschall.com/sw/mod_rewrite/docs/mod_rewrite/solutions.html:
51
52 ...is generated via WML by some nice meta-tags and 1dot-images. This cannot be
53 used for our Apache distribution tree. So, we have to start over with the
54 plain HTML markup code (bahhh!) and convert the 1dot-image hacks to plain HTML

Exhibit 10 to the Request for Re-examination of U.S. Patent No. 6,687,746 Page 1 of 2 Page
Ralf Engelschall’s original email to Apache Developer’s List (annotated)

1 stuff.
2
3 > Virtual User Hosts
4 > Problem Description:
5 > Assume that you want to provide www.username.host.domain.com for the
6 > homepage of username via just DNS A records to the same machine and
7 > without any virtualhosts on this machine.
8 > Problem Solution:
9 > For HTTP/1.0 requests there is no solution, but for HTTP/1.1 requests
10 > which contain a Host: HTTP header we can use the following ruleset to
11 > rewrite http://www.username.host.com/anypath internally to
12 > /home/username/anypath:
13 > RewriteEngine on
14 > RewriteCond %{HTTP_HOST} ^www\.[^.]+\.host\.com$
15 > RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
16 > RewriteRule ^www\.([^.]+)\.host\.com(.*) /home/$1$2
17
18 With the newer rewriting engine in Apache 1.3 this can be coded more compactly
19 (in theory, I have not tested it):
20
21 RewriteEngine on
22 RewriteCond %{HTTP_HOST} ^www\.([^.]+)\.host\.com$
23 RewriteRule ^(/.*) /home/%1$1
24
25 And BTW: Because of the restrictions you mentioned, couldn't we try the URL
26 Look-Ahead feature (%{LA-U:url}) of mod_rewrite to overcome some stuff? What I
27 mean is this (I hope it still works, because I tried such stuff 1996 the last
28 time ;_):
29
30 RewriteEngine on
31 RewriteCond %{HTTP_HOST} ^www\.([^.]+)\.host\.com$
32 RewriteRule ^(/.*) /~%1$1 [C]
33 RewriteRule .* %{LA-U:REQUEST_FILENAME}
34
35 This should first rewrite http://www.USER.host.com/foo/ to /~USER/foo/, then
36 do a URL-based subrequest for this and then lookup the target filename which
37 is then used as the URL/filename substitution in the main request. Hmm...
38 but perhaps I'm totally crazy and we are now approaching sendmail.cf...
39
40 Greetings,
41 Ralf S. Engelschall
42 rse@engelschall.com
43 www.engelschall.com
44

Exhibit 10 to the Request for Re-examination of U.S. Patent No. 6,687,746 Page 2 of 2 Page