December 2007
Beginner to intermediate
310 pages
8h 8m
English
You want to migrate pathnames under a single hostname to distinct hostnames.
Use RewriteRule in httpd.conf:
RewriteRule "^/(patha|pathb|pathc)(/.*)" "http://$1.example.com$2" [R] RewriteRule "^/([^./]*)(/.*)" "http://$1.example.com$2" [R] RewriteRule "^/~([^./]*)(/.*)" "http://$1.example.com$2" [R]
The first recipe redirects requests of the form http://example.com/pathseg/some/file.html to a
different host, such as http://pathseg.example.com/some/file.html, but only for
those requests in which pathseg is patha, pathb, or pathc.
The second recipe does the same thing, except that any top-level path segment is redirected in this manner.
The third recipe splits the difference, redirecting all “user” requests to distinct hosts with the same name as the user.
Read now
Unlock full access