<div>Hello,</div><div><br></div><div>Thanks for the quick reply. I apologize ahead-of-time if this is the incorrect way to reply to messages on here. I have my notification settings set to once per day.</div><div><br></div>
<div>Anyways, this would definitely work for redirects. Is it possible to do it in a way that is transparent to the end-user and my WSGI Application server? Basically, when the user accesses <a href="http://username.example.com/foo/bar/">username.example.com/foo/bar/</a> then my WSGI Application would just see "<a href="http://example.com/username/foo/bar/">example.com/username/foo/bar/</a>". I'm trying to get around a limitation of django where it processes URLs based on the path alone. I mainly want this done dynamically so I don't have thousands of configuration directives going on.</div>
<div><br></div><div>Thanks again!</div><div> </div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span style>------------------------------</span><br style><br style><span style>Message: 3</span><br style><span style>Date: Thu, 22 Mar 2012 00:33:02 +0400</span><br style><span style>From: "Valentin V. Bartenev" <</span><a href="mailto:ne@vbart.ru" style>ne@vbart.ru</a><span style>></span><br style>
<span style>To: </span><a href="mailto:nginx@nginx.org" style><span class="il" style="background-image:initial;background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">nginx</span>@<span class="il" style="background-image:initial;background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">nginx</span>.org</a><br style>
<span style>Subject: Re: Rewrite Subdomains to Paths</span><br style><span style>Message-ID: <</span><a href="mailto:201203220033.02956.ne@vbart.ru" style>201203220033.02956.ne@vbart.ru</a><span style>></span><br style>
<span style>Content-Type: Text/Plain; charset="iso-8859-6"</span><br style><br style><span style>On Thursday 22 March 2012 00:15:00 </span><span class="il" style>Kurtis</span><span style> Mullins wrote:</span><br style>
<span style>> Hey,</span><br style><span style>></span><br style><span style>> Is it possible to rewrite subdomains to paths? I want to do something like</span><br style><span style>> this:</span><br style><span style>></span><br style>
<span style>> </span><a href="http://x.example.com/foo/bar/" target="_blank" style>x.example.com/foo/bar/</a><span style> -> </span><a href="http://www.example.com/x/foo/bar/" target="_blank" style>www.example.com/x/foo/bar/</a><br style>
<span style>></span><br style><br style><span style> server {</span><br style><span style> server_name ~^(?P<subdomain>.+)\.example\.</span><span style>com$;</span><br style><br style><span style> location / {</span><br style>
<span style> return 301 </span><a href="http://www.example.com/$subdomain$request_uri" target="_blank" style>http://www.example.com/$subdomain$request_uri</a><span style>;</span><br style><span style> }</span><br style>
<span style> }</span><br style><br style><span style> wbr, Valentin V. Bartenev</span></blockquote>