[dancer-users] Perl Dancer Rewrite url

Alex Mestiashvili mailatgoogl at gmail.com
Thu Oct 22 19:39:31 BST 2015


On Thu, Oct 22, 2015 at 6:11 PM, Hugues <hugues at max4mail.com> wrote:

> Hello
>
> see my rewrite log
>
> init rewrite engine with requested uri /website/about
> applying pattern '^/website/(.*)' to uri '/website/about'
> rewrite '/website/about' -> '/'
> applying pattern '^/(.*)' to uri '/'
> rewrite '/about' -> 'http://localhost:5002/about'
> forcing proxy-throughput with http://localhost:5002/about
> go-ahead with proxy request proxy:http://localhost:5002/about [OK]
>
> but /about route do not existe, this is /website/about and I've got a
> 404...
>



> It seems like Rewrite Rules is not a possible ( or if I create fake routes
> /about....)
>


So,  what are you trying to do:

1 map http://mydomain.com/website/(.*) to http://localhost:5002/$1 ?
2 map http://mydomain.com/website/(.*) to http://localhost:5002//website/$1
?
3 map http://mydomain.com/website/(.*) to http://localhost:5002/$1 ?
4 map http://mydomain/(.*) to http://localhost:5002/website/$1 ?

Also you can easily change the prefix of the whole Dancer application by
using the prefix feature, see the cookbook examples.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20151022/9fdb8b92/attachment.html>


More information about the dancer-users mailing list