We have encountered a number of cases in which it would be useful to map a portion of a bridge data space. (For example, the http://www.nrphp.org/ site.) Initially we have handled this through redirects: A request for the top-level URL for the domain gets redirected to the appropriate place in the bridge dataspace. This has the unfortunate side-effect of replacing the host name in the url.

There are a number of things that can be used to fix this to varying degrees:
  1. Removing the host name from link and re-direct urls generated by the bridge server.
    • This will eliminate hostname replacement
    • But will not hide the path to the content in the url. For example, the http://www.nrphp.org/ request would be redirected to http://www.nrphp.org/public/projects/nrphp/.
    • But will still allow potentially confusing navigation to other parts of the site. This could be problematic for (e.g.) search engines, since it would not make sense for NAVCIITI materials to appear on a URL that starts with http://www.nrphp.org/.
  2. Supporting directory-level redirects within bridge based on requested hostname. This could be done by mapping multiple roots (ideally configured within the system) for different host names.
    • DispatchServlet.RootObjectSource(...) could be used for this.
    • Each virtual host could have a different port to distinguish these when proxied.
    • But, given the obscurity of this requirement, just handling it with apache rewrites or a script

Notes:
  • URLs generated for embedded links do not currently include hostnames.
  • Redirects to default page in WebSiteServlet include hostnames, currently taken from the codebase property. This is necessary because simply redirecting to a path will result in the servlet engine's host and port number being used.
  • URLs generated in imagemaps appear to use EmbeddedObjectPath.getURL(...), which adds a hostname. If preferred hostname is added as a property of WebSite, EOPath could use that when building a URL.


Initial implementation (0212):
  • Added optional URL property to bridge.apps.web.WebSite. EmbeddedObjectPath.getURL(...) will use this url prefix if available.
  • Switched Apache configuration for alterante hostnames from ProxyPass directive to mod_rewrite directives, which are considerably more flexible. An example (for mapping nrphp.org addresses to the bridge server on foo:3366) looks like:
<VirtualHost www.nrphp.org>
 ...
 RewriteEngine on
 RewriteRule ^/public/projects/nrphp/(.*) /$1
 RewriteRule ^/public/(.*)   http://foo.cs.vt.edu:3366/public/$1 [P]
 RewriteRule ^/private/(.*)  http://foo.cs.vt.edu:3366/private/$1 [P]
 RewriteRule ^/live(.*)      http://foo.cs.vt.edu:3366/live$1 [P]
 RewriteRule ^/([^~].*)      http://foo.cs.vt.edu:3366/public/projects/nrphp/$1 [P]
 RewriteRule ^/$     http://foo.cs.vt.edu:3366/public/projects/nrphp/index.html [P]
</VirtualHost>


/public/projects/bridge/design/Multiple hostname support Login | Web Editor | Full Editor
Last modified 9/11/03 2:33 PM by isenhour (history)
Site contents