lighttpd forum lighty > vhost and www.

Posted by Alex (Guest)
on 06.03.2008 04:15
i know how apache has ALIAS for vhost, but if we do XXX.com, the 
WWW.XXX.com will not work

what is the best way around this, this includes multiple vhosts
Posted by Guest (Guest)
on 06.03.2008 04:16
Alex wrote:
> i know how apache has ALIAS for vhost, but if we do XXX.com, the 
> WWW.XXX.com will not work
> 
> what is the best way around this, this includes multiple vhosts

stroke your cack
Posted by Olaf van der Spek
on 06.03.2008 10:59
Alex wrote:
> what is the best way around this, this includes multiple vhosts

$HTTP["host"] =~ "^www\.(.*)$" {
  url.redirect = ( "^/(.*)" => "http://%1/$1" )
}
Posted by Alex (Guest)
on 06.03.2008 12:26
Olaf van der Spek wrote:
> Alex wrote:
>> what is the best way around this, this includes multiple vhosts
> 
> $HTTP["host"] =~ "^www\.(.*)$" {
>   url.redirect = ( "^/(.*)" => "http://%1/$1" )
> }

i noticed the config already has

#### both rewrite/redirect support back reference to regex conditional 
using %n
$HTTP["host"] =~ "^www\.(.*)" {
  url.redirect             = ( "^/(.*)" => "http://%1/$1" )
}


what effect does => and = (which you gave) have
Posted by Alex (Guest)
on 06.03.2008 12:34
nevermind the long spacing made me look at the wrong sign
Posted by Olaf van der Spek
on 06.03.2008 13:57
Alex wrote:
> Olaf van der Spek wrote:
>> Alex wrote:
>>> what is the best way around this, this includes multiple vhosts
>> 
>> $HTTP["host"] =~ "^www\.(.*)$" {
>>   url.redirect = ( "^/(.*)" => "http://%1/$1" )
>> }
> 
> i noticed the config already has

Doesn't that solve your problem?
Posted by Alex (Guest)
on 06.03.2008 13:59
it works fine i was just wondering why it had already
$HTTP["host"] =~ "^www\.(.*)" in the config commented and you gave
$HTTP["host"] =~ "^www\.(.*)$"

what significant difference does the $ make
Posted by carlos (Guest)
on 25.04.2008 16:41
Olaf van der Spek wrote:
> Alex wrote:
>> it works fine i was just wondering why it had already
>> $HTTP["host"] =~ "^www\.(.*)" in the config commented and you gave
>> $HTTP["host"] =~ "^www\.(.*)$"
>> 
>> what significant difference does the $ make
> 
> Ah. I think none.

Hello, I have the same problem, but what I didn't understand is, where 
to put these lines?
Thanks.
Posted by Olaf van der Spek
on 25.04.2008 18:03
carlos wrote:
> Olaf van der Spek wrote:
>> Alex wrote:
>>> it works fine i was just wondering why it had already
>>> $HTTP["host"] =~ "^www\.(.*)" in the config commented and you gave
>>> $HTTP["host"] =~ "^www\.(.*)$"
>>> 
>>> what significant difference does the $ make
>> 
>> Ah. I think none.
> 
> Hello, I have the same problem, but what I didn't understand is, where 
> to put these lines?

In lighttpd.conf.
Posted by Olaf van der Spek
on 25.04.2008 22:12
carlos wrote:
> 
>>>>> it works fine i was just wondering why it had already
>>>>> $HTTP["host"] =~ "^www\.(.*)" in the config commented and you gave
>>>>> $HTTP["host"] =~ "^www\.(.*)$"
>>>>> 
>>>>> what significant difference does the $ make
>>>> 
>>>> Ah. I think none.
>>> 
>>> Hello, I have the same problem, but what I didn't understand is, where 
>>> to put these lines?
>> 
>> In lighttpd.conf.
> D..., I don't have that file, I'm using a centOS 5.1 server, do I should 
> to put these lines in httpd.conf?

If that's the conf file Lighttpd is using, yes.
Posted by carlos (Guest)
on 25.04.2008 22:24
Olaf van der Spek wrote:
> carlos wrote:
>> 
>>>>>> it works fine i was just wondering why it had already
>>>>>> $HTTP["host"] =~ "^www\.(.*)" in the config commented and you gave
>>>>>> $HTTP["host"] =~ "^www\.(.*)$"
>>>>>> 
>>>>>> what significant difference does the $ make
>>>>> 
>>>>> Ah. I think none.
>>>> 
>>>> Hello, I have the same problem, but what I didn't understand is, where 
>>>> to put these lines?
>>> 
>>> In lighttpd.conf.
>> D..., I don't have that file, I'm using a centOS 5.1 server, do I should 
>> to put these lines in httpd.conf?
> 
> If that's the conf file Lighttpd is using, yes.

Well, it's, but I think it's just a instruction for lighttpd, because 
when I put the instruction and restart the httpd service, it give me a 
"failed", do you have an other idea to solve this problem?
Posted by Olaf van der Spek
on 26.04.2008 07:53
carlos wrote:
> Well, it's, but I think it's just a instruction for lighttpd, because 
> when I put the instruction and restart the httpd service, it give me a 
> "failed", do you have an other idea to solve this problem?

httpd sounds like Apache, not Lighttpd.
I'm not familiar with CentOS, so I can't help you further.