httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas -Balu- Walter ...@itreff.de>
Subject AliasMatch / minimal match?
Date Sun, 28 Jul 2002 16:13:02 GMT
Hello experts,

I am stuck in setting up a regex to be used in the AliasMatch-directive
in Apache.

I want to make it possible to access some of my virtual webspaces even
if Apache was not yet configured or DNS-update takes too long :)

My virtual webspaces can be found in a directory structure like

/home/vwww/example.com/host/htdocs/

I wanted to make it possible to call that in a browser using:

http://localhost/vwww/host.example.com/

To do so, I've tried to set up a directive like:

AliasMatch ^/vwww/(.*)\.(.*)/(.*)$ /home/vwww/$2/$1/htdocs/$3
                             ^^^^ path $3
                        ^^^^ example.com $2
                  ^^^^ host $1

But since the regexp matches the longest possible match. I get the
following matches:

        $1 = host.example
        $2 = com

and not my needed result:

        $1 = host
        $2 = example.com

I've tried to make the first (.*) a (.*?) to get minimal matching like
it is supported by perl(?), but Apache does not seem to support it? At
least it tells me that it can not compile the regexp while trying to
start it.

Any ideas or suggestions what regexp I am supposed to use?

     Balu

PS: Same problem happens with the path:
http://localhost/vwww/www.example.com/some/path/index.html

gives me
        $1 = www.example
        $2 = com/some/path
        $3 = index.html
-- 
Windows is something like fast-food: 
It's finished in no time, but you don't get a full-filled feeling, and 
you can start again.                      - Bas Lijten (Holland) in #lfs

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


Mime
View raw message