You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Mitch Vincent <mi...@unixprogramming.net> on 2002/09/19 19:19:19 UTC

[users@httpd] mod_vhost_alias - last time, I promise

I'm still hoping someone out there has figured this out...

--------------

I'm hosting a lot of websites and am interesting in getting more 
organized.. I had used the rewrite module to do this before but I see 
the mod_vhost_alias module it looks like a little less hackish way of 
accomplishing the same thing...

What I want to do is organize directories like this :

/usr/site/www/<domain>/<requested URL>

but I can't seem to get the rules to work for every hostname.. Using

/usr/site/www/%2+/%0

gets it right when someone wants www.example.com but not when someone 
wants www.something.example.com

and /usr/site/www/%3+/%0

gets it when they want www.something.example.com but not www.example.com

Am I missing something simple? I doubt I'm the first to want to 
organize things this way but I can't seem to find anything on how to do 
it..

Thanks!!!

--------------

-Mitch

Some people will always try to ice skate up hill.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_vhost_alias - last time, I promise

Posted by Mitch Vincent <mi...@unixprogramming.net>.
Thanks for the info -- I just got back and tried it and get something 
like this when using %-2+ :

/usr/site/www/www.example/www.example.com/

when requesting www.example.com

What I think I want is something like

VirtualDocumentRoot /usr/site/www/%-1.%-2/%0

but that doesn't work since you can't combine those like that.

Is there something that will always give me the first two parts of the 
host name ( the domain) no matter what is requested?

Thanks again for your help!

On Thursday, September 19, 2002, at 11:04  AM, Joshua Slive wrote:

> Mitch Vincent wrote:
>>> If I make the guess that you always want <domain> to be the last two 
>>> parts of the hostname, then you would simply use %-2+, which would 
>>> get you an example.com result from both www.something.example.com 
>>> and www.example.com.  If that is not what you want, you'll have to 
>>> actually tell us what it is you do want.
>>>
>> I want to organize my filesystem like this :
>> /usr/site/www/example.com/anything.in.the.world.from.example.com
>> I want to have al hostname of example.com under a directory called 
>> example.com
>> Sorry for not being clear, thank you for the reply!
>
> Yep, that's clearer and my guess was right.  So use %-2+ to get the 
> last two parts of the hostname.
>
> Joshua.
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server 
> Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
>

-Mitch

Computers are like Air Conditioners, they don't work when you open 
Windows.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_vhost_alias - last time, I promise

Posted by Joshua Slive <jo...@slive.ca>.
Mitch Vincent wrote:
>> If I make the guess that you always want <domain> to be the last two 
>> parts of the hostname, then you would simply use %-2+, which would get 
>> you an example.com result from both www.something.example.com and 
>> www.example.com.  If that is not what you want, you'll have to 
>> actually tell us what it is you do want.
>>
> 
> I want to organize my filesystem like this :
> 
> /usr/site/www/example.com/anything.in.the.world.from.example.com
> 
> I want to have al hostname of example.com under a directory called 
> example.com
> 
> Sorry for not being clear, thank you for the reply!

Yep, that's clearer and my guess was right.  So use %-2+ to get the last 
two parts of the hostname.

Joshua.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_vhost_alias - last time, I promise

Posted by Mitch Vincent <mi...@unixprogramming.net>.
> Mitch Vincent wrote:
>> What I want to do is organize directories like this :
>> /usr/site/www/<domain>/<requested URL>
>> but I can't seem to get the rules to work for every hostname.. Using
>> /usr/site/www/%2+/%0
>> gets it right when someone wants www.example.com but not when someone 
>> wants www.something.example.com
>> and /usr/site/www/%3+/%0
>> gets it when they want www.something.example.com but not 
>> www.example.com
>> Am I missing something simple? I doubt I'm the first to want to 
>> organize things this way but I can't seem to find anything on how to 
>> do it..
>
> Part of the reason you aren't getting a response is because you aren't 
> asking a clear question.  EXACTLY WHAT do you want for <domain>?  It 
> is not in any way clear from your question.
> If I make the guess that you always want <domain> to be the last two 
> parts of the hostname, then you would simply use %-2+, which would get 
> you an example.com result from both www.something.example.com and 
> www.example.com.  If that is not what you want, you'll have to 
> actually tell us what it is you do want.
>

I want to organize my filesystem like this :

/usr/site/www/example.com/anything.in.the.world.from.example.com

I want to have al hostname of example.com under a directory called 
example.com

Sorry for not being clear, thank you for the reply!

-Mitch


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_vhost_alias - last time, I promise

Posted by Joshua Slive <jo...@slive.ca>.
Mitch Vincent wrote:
> What I want to do is organize directories like this :
> 
> /usr/site/www/<domain>/<requested URL>
> 
> but I can't seem to get the rules to work for every hostname.. Using
> 
> /usr/site/www/%2+/%0
> 
> gets it right when someone wants www.example.com but not when someone 
> wants www.something.example.com
> 
> and /usr/site/www/%3+/%0
> 
> gets it when they want www.something.example.com but not www.example.com
> 
> Am I missing something simple? I doubt I'm the first to want to organize 
> things this way but I can't seem to find anything on how to do it..

Part of the reason you aren't getting a response is because you aren't 
asking a clear question.  EXACTLY WHAT do you want for <domain>?  It is 
not in any way clear from your question.

If I make the guess that you always want <domain> to be the last two 
parts of the hostname, then you would simply use %-2+, which would get 
you an example.com result from both www.something.example.com and 
www.example.com.  If that is not what you want, you'll have to actually 
tell us what it is you do want.

Joshua.



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org