<div dir="ltr"><div>Hi,<br><br></div>Thanks, I was just not sure anymore, too long ago.<br><br>But you say that the full URL consists of req.http.host and req.url, does that really matter in this case as req.url stays untouched ?<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-01-07 14:03 GMT+01:00 Per Buer <span dir="ltr"><<a href="mailto:perbu@varnish-software.com" target="_blank">perbu@varnish-software.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Wed, Jan 7, 2015 at 1:55 PM, Matt . <span dir="ltr"><<a href="mailto:yamakasi.014@gmail.com" target="_blank">yamakasi.014@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All,<br>
<br>
In the past I tested some scripts on on varnish for rewriting a domainname.<br>
<br>
My idea would be <a href="http://foo.com/*" target="_blank">foo.com/*</a> to <a href="http://bla.com/$1" target="_blank">bla.com/$1</a><br>
<br>
Can I accomplish this with just something like:<br>
<br>
if (req.http.host ~ "<a href="http://foo.com" target="_blank">foo.com</a>") {<br>
set req.http.host = "<a href="http://bla.com/$1" target="_blank">bla.com/$1</a>";<br>
}<br></blockquote><div><br></div></span><div>Unless I missed something essential you could just do</div><span class=""><div><br></div><div>if (req.http.host ~ "<a href="http://foo.com" target="_blank">foo.com</a>") {</div></span><div>      set req.http.host = "<a href="http://bar.com" target="_blank">bar.com</a>";</div><div>}</div><div><br></div><div>req.url will stay untouched. Remember that the full URL consists of req.http.host and req.url.</div></div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div><div dir="ltr"><table style="border-bottom-width:1px;padding-top:5px;border-top-style:solid;width:550px;padding-bottom:5px;border-bottom-color:rgb(238,238,238);border-top-width:1px;border-bottom-style:solid;line-height:1.5em;border-top-color:rgb(238,238,238);color:rgb(102,102,102);font-size:12px;font-family:'Helvetica Neue',Arial,sans-serif;margin-top:20px" border="0" cellpadding="0" cellspacing="0"><tbody><tr><td width="100"><img src="http://www.varnish-software.com/static/media/logo-email.png"></td><td><font color="#222222"><span style="font-size:14px"><b>Per Buer</b></span></font><br>CTO | Varnish Software AS<br>Cell: <a value="+4790181750" style="color:rgb(17,85,204)">+47 95839117</a><br><span style="font-weight:bold">We Make Websites Fly!<br><a href="https://www.varnish-software.com/" style="color:rgb(17,85,204)" target="_blank">www.varnish-software.com</a></span></td></tr></tbody></table><br><div style="color:rgb(136,136,136)"><a href="http://info.varnish-software.com/varnish-summits-autumn-2014-registration" style="color:rgb(17,85,204)" target="_blank"><img src="https://www.varnish-software.com/sites/default/files/u388/masters_s_0.png" alt=" Register now"></a></div></div></div>
</font></span></div></div>
</blockquote></div><br></div>