Simple redirect to correct a URL

Guillaume Quintard guillaume at varnish-software.com
Fri Jan 6 09:14:50 CET 2017


Not to beat my own drum, but I blogged about this recently:
https://info.varnish-software.com/blog/rewriting-urls-with-varnish-redirection

TL;DR: you need a 30X return code, and to put the new URL in the correct
header (location).

On Jan 6, 2017 02:06, "Kari Cowan" <KCowan at alm.com> wrote:

> I’m sure I must be doing something hair-brained … shouldn’t this work in
> V5?
>
>
>
> if (req.url~ "^/type/news?$") {
>
>    return (synth (750,"http://" + req.http.Host + "/news/"));
>
> }
>
> _______________________________________________
> varnish-dev mailing list
> varnish-dev at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20170106/eacda597/attachment.html>


More information about the varnish-dev mailing list