FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 07-19-2010, 10:26 AM
Camaleón
 
Default lighttpd redirect rules

On Mon, 19 Jul 2010 17:50:29 +0800, nzsell wrote:

>> Does this help?
>>
>> http://redmine.lighttpd.net/projects/lighttpd/wiki/HowToRedirectWww

> doesn't help much.
> I've read that before, but still can't figure out.

Uh. You mean this is not working for you?

***
$HTTP["host"] == "abc123.example.com" {
url.redirect = (
"^/(.*)" => "http://www.example.com/pages/page.php?u=abc123",
)
}
***

If no, review the logs, the modules being loaded (redirect) and your
virtual domain setup. Or just try with a simple redirection (one file to
another under same host, same root path) to check it's working fine.

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2010.07.19.10.26.41@gmail.com">http://lists.debian.org/pan.2010.07.19.10.26.41@gmail.com
 
Old 07-19-2010, 11:00 AM
 
Default lighttpd redirect rules

Thanks for the reply. But it's not quite what I'm looking for.
The abc123 is a variable.

I'm looking for a rule that redirect this:

http://abc123.example.com to
http://www.example.com/pages/page.php?u=abc123

http://111.example.com to
http://www.example.com/pages/page.php?u=111

http://222.example.com to
http://www.example.com/pages/page.php?u=222

http://david.example.com to
http://www.example.com/pages/page.php?u=david

you see the pattern?

http://[name].example.com to
http://www.example.com/pages/page.php?u=[name]




> On Mon, 19 Jul 2010 17:50:29 +0800, nzsell wrote:
>
>>> Does this help?
>>>
>>> http://redmine.lighttpd.net/projects/lighttpd/wiki/HowToRedirectWww
>
>> doesn't help much.
>> I've read that before, but still can't figure out.
>
> Uh. You mean this is not working for you?
>
> ***
> $HTTP["host"] == "abc123.example.com" {
> url.redirect = (
> "^/(.*)" => "http://www.example.com/pages/page.php?u=abc123",
> )
> }
> ***
>
> If no, review the logs, the modules being loaded (redirect) and your
> virtual domain setup. Or just try with a simple redirection (one file to
> another under same host, same root path) to check it's working fine.
>
> Greetings,
>
> --
> Camaleón
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
> listmaster@lists.debian.org
> Archive: http://lists.debian.org/pan.2010.07.19.10.26.41@gmail.com
>
>



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 097a157d2dacb1e0dcc2079f32a87941.squirrel@morefb.c om">http://lists.debian.org/097a157d2dacb1e0dcc2079f32a87941.squirrel@morefb.c om
 
Old 07-19-2010, 12:49 PM
Camaleón
 
Default lighttpd redirect rules

On Mon, 19 Jul 2010 19:00:58 +0800, vinboy wrote:

> Thanks for the reply. But it's not quite what I'm looking for. The
> abc123 is a variable.

Oh. And you thought people should have guess that "abc123" was a variable
value without further notice >;-)

> I'm looking for a rule that redirect this:
>
> http://abc123.example.com to
> http://www.example.com/pages/page.php?u=abc123
>
> http://111.example.com to
> http://www.example.com/pages/page.php?u=111
>
> http://222.example.com to
> http://www.example.com/pages/page.php?u=222
>
> http://david.example.com to
> http://www.example.com/pages/page.php?u=david
>
> you see the pattern?
>
> http://[name].example.com to
> http://www.example.com/pages/page.php?u=[name]

I don't see anything wrong with that setup? :-?

You can have as many redirections as you like. Just make them static,
because OTOH, you'll have to use a static value, at least for the host
part.

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2010.07.19.12.49.21@gmail.com">http://lists.debian.org/pan.2010.07.19.12.49.21@gmail.com
 
Old 07-19-2010, 03:05 PM
"V"
 
Default lighttpd redirect rules

Making them static is bad.

The Apache .htaccess is as follow, can you translate them to lighttpd?

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.
RewriteCond %{HTTP_HOST} ^(.+).example.com
RewriteRule ^(.*) http://www.example.com/pages/page.php?u=%1 [R=301,L]



> On Mon, 19 Jul 2010 19:00:58 +0800, vinboy wrote:
>
>> Thanks for the reply. But it's not quite what I'm looking for. The
>> abc123 is a variable.
>
> Oh. And you thought people should have guess that "abc123" was a variable
> value without further notice >;-)
>
>> I'm looking for a rule that redirect this:
>>
>> http://abc123.example.com to
>> http://www.example.com/pages/page.php?u=abc123
>>
>> http://111.example.com to
>> http://www.example.com/pages/page.php?u=111
>>
>> http://222.example.com to
>> http://www.example.com/pages/page.php?u=222
>>
>> http://david.example.com to
>> http://www.example.com/pages/page.php?u=david
>>
>> you see the pattern?
>>
>> http://[name].example.com to
>> http://www.example.com/pages/page.php?u=[name]
>
> I don't see anything wrong with that setup? :-?
>
> You can have as many redirections as you like. Just make them static,
> because OTOH, you'll have to use a static value, at least for the host
> part.
>
> Greetings,
>
> --
> Camaleón
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
> listmaster@lists.debian.org
> Archive: http://lists.debian.org/pan.2010.07.19.12.49.21@gmail.com
>
>



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: fcea38b4b96b8440629affa04bc9d7fe.squirrel@morefb.c om">http://lists.debian.org/fcea38b4b96b8440629affa04bc9d7fe.squirrel@morefb.c om
 
Old 07-19-2010, 03:43 PM
Eduardo M KALINOWSKI
 
Default lighttpd redirect rules

On Seg, 19 Jul 2010, V wrote:

Making them static is bad.

The Apache .htaccess is as follow, can you translate them to lighttpd?

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.
RewriteCond %{HTTP_HOST} ^(.+).example.com
RewriteRule ^(.*) http://www.example.com/pages/page.php?u=%1 [R=301,L]


You really don't want to do your homework, do you?

The page mentioned, while not very detailed, has examples that show
how such things can be done. The second example, in particular, is the
closest to what you need: it redirects any domain.


--
Eduardo M KALINOWSKI
eduardo@kalinowski.com.br


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 20100719124345.20427iun6v9ezzwg@mail.kalinowski.co m.br">http://lists.debian.org/20100719124345.20427iun6v9ezzwg@mail.kalinowski.co m.br
 

Thread Tools




All times are GMT. The time now is 03:57 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org