Hi Joe,

One more rewrite.

On Dec 25, 2011, at 1:22 PM, Joe Schaefer wrote:

> Current vhost:
> 
> <VirtualHost *:80 *:443>
>    DocumentRoot /x1/www/ooo-site.apache.org/content
>    ServerName ooo-site.apache.org
>    ServerAlias *.openoffice.org
>    ServerAlias openoffice.org
>    UseCanonicalName Off
>    RewriteEngine On
>    RewriteOptions inherit
>    RewriteRule ^/favicon.ico /x1/www/ooo-site.apache.org/content/favicon.ico
> 
>    RewriteMap lowercase int:tolower
> 
>    # qa.openoffice.org
>    RewriteCond ${lowercase:%{SERVER_NAME}} ^qa(?:\.\w+)?\.openoffice\.org$
>    RewriteRule /issues/(.*) https://issues.apache.org/ooo/$1 [L]

There is one more url form that needs this rewrite:

http://www.openoffice.org/issues/show_bug.cgi?id=100436

Regards,
Dave

> 
>    # contributing.openoffice.org
>    RewriteCond ${lowercase:%{SERVER_NAME}} 
> ^contributing(?:\.\w+)?\.openoffice\.org$
>    RewriteRule (.*) 
> http://incubator.apache.org/openofficeorg/get-involved.html [L]
> 
>    # security.openoffice.org
>    RewriteCond ${lowercase:%{SERVER_NAME}} 
> ^security(?:\.\w+)?\.openoffice\.org$
>    RewriteRule (.*) http://incubator.apache.org/openofficeorg/security.html 
> [L]
>    
>    # change foo.openoffice.org/... to www.openoffice.org/foo/... if exists
>    RewriteCond ${lowercase:%{SERVER_NAME}} ^(\w+)(?:\.\w+)?\.openoffice\.org$
>    RewriteCond /x1/www/ooo-site.apache.org/content/%1 -d
>    RewriteRule ^(.*)$ ${lowercase:%{SERVER_NAME}}$1 [C]
>    RewriteRule ^(\w+)(?:\.\w+)?\.openoffice\.org/(.*) 
> http://www.openoffice.org/$1/$2 [L]
> 
>    </VirtualHost>
> 
> 
> 
> HTH
> 
> 
> 
> 
>> ________________________________
>> From: Dave Fisher <[email protected]>
>> To: Joe Schaefer <[email protected]> 
>> Cc: "[email protected]" <[email protected]>; 
>> "[email protected]" <[email protected]> 
>> Sent: Sunday, December 25, 2011 4:18 PM
>> Subject: Re: *.openoffice.org testing
>> 
>> Hi Joe,
>> 
>> Works great!
>> 
>> BTW - I have a patch for ASF/Util.pm / sort_tables for you. It does columns 
>> of rows - side by side.
>> 
>> Regards,
>> Dave
>> 
>> On Dec 25, 2011, at 1:09 PM, Joe Schaefer wrote:
>> 
>>> Made some adjustments based on your feedback.
>>> Try testing again.
>>> 
>>> From: Dave Fisher <[email protected]>
>>> To: [email protected] 
>>> Cc: "[email protected]" <[email protected]> 
>>> Sent: Sunday, December 25, 2011 3:57 PM
>>> Subject: Re: *.openoffice.org testing
>>> 
>>> Hi Joe,
>>> 
>>> Some of these aren't working the way I expected.  projects.openoffice.org 
>>> and qa.openoffice.org are currently losing their style.
>>> 
>>>>     # change foo.openoffice.org/... to ${DocumentRoot}/content/foo/... if 
>>>> exists
>>>>     RewriteCond ${lowercase:%{SERVER_NAME}} 
>>>> ^(\w+)(?:\.\w+)?\.openoffice\.org$
>>>>     RewriteCond /x1/www/ooo-site.apache.org/content/%1 -d
>>>>     RewriteRule ^(.*)$ ${lowercase:%{SERVER_NAME}}$1 [C]
>>>>     RewriteRule ^(\w+)(?:\.\w+)?\.openoffice\.org/(.*) 
>>>> /x1/www/ooo-site.apache.org/content/$1/$2
>>> 
>>> I think that this needs an [L]
>>> 
>>> I'm expecting and have written hrefs to expect that foo is in the url 
>>> www.openoffice.org/foo/ after the redirect.
>>> 
>>> I'm not sure what this rule is for:
>>> 
>>>>   # change proj.openoffice.org/... to www.openoffice.org/projects/proj/... 
>>>> if exists
>>>>     RewriteCond ${lowercase:%{SERVER_NAME}} 
>>>> ^(\w+)(?:\.\w+)?\.openoffice\.org$
>>>>     RewriteCond /x1/www/ooo-site.apache.org/content/projects/%1 -d
>>>>     RewriteRule ^(.*)$ ${lowercase:%{SERVER_NAME}}$1 [C]
>>>>     RewriteRule ^(\w+)(?:\.\w+)?\.openoffice\.org/(.*) 
>>>> http://www.openoffice.org/projects/$1/$2 [L]
>>> 
>>> Regards,
>>> Dave
>>> 
>>> 
>>> On Dec 25, 2011, at 12:42 PM, Joe Schaefer wrote:
>>> 
>>>> The webserver is now configured properly for
>>>> *.openoffice.org.  To test add a line similar
>>>> to
>>>> 
>>>> 140.211.11.131 www.openoffice.org contributing.openoffice.org 
>>>> aa.openoffice.org projects.openoffice.org security.openoffice.org 
>>>> qa.openoffice.org
>>>> 
>>>> 
>>>> to your /etc/hosts file and hit a few urls with
>>>> those hostnames.  For the crufty mod_rewrite veteran,
>>>> the VirtualHost we're using is as follows:
>>>> 
>>>> <VirtualHost *:80 *:443>
>>>>     DocumentRoot /x1/www/ooo-site.apache.org/content
>>>>     ServerName ooo-site.apache.org
>>>>     ServerAlias *.openoffice.org
>>>>     ServerAlias openoffice.org
>>>>     UseCanonicalName Off
>>>>     RewriteEngine On
>>>>     RewriteOptions inherit
>>>>     RewriteRule ^/favicon.ico 
>>>> /x1/www/ooo-site.apache.org/content/favicon.ico
>>>> 
>>>>     RewriteMap lowercase int:tolower
>>>> 
>>>>     # qa.openoffice.org
>>>>     RewriteCond ${lowercase:%{SERVER_NAME}} ^qa(?:\.\w+)?\.openoffice\.org$
>>>>     RewriteRule /issues/(.*) https://issues.apache.org/ooo/$1 [L]
>>>> 
>>>>     # contributing.openoffice.org
>>>>     RewriteCond ${lowercase:%{SERVER_NAME}} 
>>>> ^contributing(?:\.\w+)?\.openoffice\.org$
>>>>     RewriteRule (.*) 
>>>> http://incubator.apache.org/openofficeorg/get-involved.html [L]
>>>> 
>>>>     # security.openoffice.org
>>>>     RewriteCond ${lowercase:%{SERVER_NAME}} 
>>>> ^security(?:\.\w+)?\.openoffice\.org$
>>>>     RewriteRule (.*) 
>>>> http://incubator.apache.org/openofficeorg/security.html [L]
>>>>     
>>>>     # change foo.openoffice.org/... to ${DocumentRoot}/content/foo/... if 
>>>> exists
>>>>     RewriteCond ${lowercase:%{SERVER_NAME}} 
>>>> ^(\w+)(?:\.\w+)?\.openoffice\.org$
>>>>     RewriteCond /x1/www/ooo-site.apache.org/content/%1 -d
>>>>     RewriteRule ^(.*)$ ${lowercase:%{SERVER_NAME}}$1 [C]
>>>>     RewriteRule ^(\w+)(?:\.\w+)?\.openoffice\.org/(.*) 
>>>> /x1/www/ooo-site.apache.org/content/$1/$2
>>>> 
>>>>   # change proj.openoffice.org/... to www.openoffice.org/projects/proj/... 
>>>> if exists
>>>>     RewriteCond ${lowercase:%{SERVER_NAME}} 
>>>> ^(\w+)(?:\.\w+)?\.openoffice\.org$
>>>>     RewriteCond /x1/www/ooo-site.apache.org/content/projects/%1 -d
>>>>     RewriteRule ^(.*)$ ${lowercase:%{SERVER_NAME}}$1 [C]
>>>>     RewriteRule ^(\w+)(?:\.\w+)?\.openoffice\.org/(.*) 
>>>> http://www.openoffice.org/projects/$1/$2 [L]
>>>> 
>>>>     </VirtualHost>
>>>> 
>>>> 
>>>> 
>>>> Note the choice of final rewrite rule for foo.openoffice.org
>>>> is a filesystem redirect so the content/foo/ dir will
>>>> function as DocumentRoot.  If that is not the
>>>> desired behavior I suggest using a redirect rule similar
>>>> to what I did for proj.openoffice.org above.
>>>> 
>>>> 
>>>> HTH
>>> 
>>> 
>>> 
>> 
>> 
>> 

Reply via email to