httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 39928] port no detected when file name not in URL
Date Fri, 07 Nov 2008 16:05:18 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=39928





--- Comment #2 from Marc Mengel <mengel@fnal.gov>  2008-11-07 08:05:17 PST ---
Okay, so after much confusion, I have a workaround for this.

First, you have to use Rewrite based mass virtual hosting, and
second you have to set an environmnent variable (i.e. MY_PORT).

So instead of:
  VirtualDocumentRoot /appora/products/web/%0:%p/html
  VirtualScriptAlias  /appora/products/web/%0:%p/cgi-bin

You need:
  RewriteCond %{ENV:MY_PORT} ^$ 
  RewriteRule (.*) $1 [env=MY_PORT:%{SERVER_PORT}]
  RewriteMap lowercase int:tolower
  RewriteCond %{REQUEST_URI} !/cgi-bin/
  RewriteRule ^/(.*)$  
/appora/products/web/%{SERVER_NAME}:%{ENV:MY_PORT}/html/$1      
  RewriteCond %{REQUEST_URI} /cgi-bin/
  RewriteRule ^/(.*)$   /appora/products/web/%{SERVER_NAME}:%{ENV:MY_PORT}/$1
[T=application/x-httpd-cgi]

This is the cook book Rewrite based mass virtual hosting, except for the part
about setting MY_PORT if it isn't set, and using MY_PORT instead of
SERVER_PORT.

Basically, somewhere the SERVER_PORT stuff gets lost when doing things like
doing an index.html lookup, but the MY_PORT environment variable doesnt.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message