9 messages in ru.sysoev.nginxRe: Rewrite url based on cookie
FromSent OnAttachments
Jason BJan 23, 2007 10:04 pm 
Igor SysoevJan 23, 2007 10:21 pm 
Jason BJan 23, 2007 10:42 pm 
Jonathan VanascoJan 24, 2007 12:08 am 
Igor SysoevJan 24, 2007 12:20 am 
Jonathan VanascoJan 24, 2007 12:51 am 
Ian EvansJan 26, 2007 2:11 am 
Igor SysoevJan 26, 2007 4:17 am 
Ian EvansJan 26, 2007 8:35 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Rewrite url based on cookieActions...
From:Jonathan Vanasco (ngin@public.gmane.org)
Date:Jan 24, 2007 12:51:05 am
List:ru.sysoev.nginx

On Jan 24, 2007, at 3:21 AM, Igor Sysoev wrote:

No, the $1 inside the "rewrite" directive is possible rewrite's capture.

ah. i never knew that! glad i asked.

You may use

if ($http_cookie ~ "cookieName=([^;]+)(?:;|$)") { set $name $1; rewrite ^/index.html$ index$name.html; }

i meant to ask that first - as i've used something similar in the past, but then it looked like i could consolidate it one line further.

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | FindMeOn.com - The cure for Multiple Web Personality Disorder | Web Identity Management and 3D Social Networking | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | RoadSound.com - Tools For Bands, Stuff For Fans | Collaborative Online Management And Syndication Tools | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -