# Redirecting to new URL

**URL:** <https://discourse.haproxy.org/t/redirecting-to-new-url/531>\
**Category:** Help!\
**Created:** [July 28, 2016, 5:44pm UTC](https://discourse.haproxy.org/t/redirecting-to-new-url/531 "2016-07-28T17:44:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![prash.devops](https://avatars.discourse-cdn.com/v4/letter/p/eb8c5e/32.png) [@prash.devops](https://discourse.haproxy.org/u/prash.devops)\
**Post date:** [July 28, 2016, 5:44pm UTC](https://discourse.haproxy.org/t/redirecting-to-new-url/531/1 "2016-07-28T17:44:13Z")

</div>

Hi,

Here is my setup.

frontend http-in-ssl  
bind \*:80  
bind \*:443 ssl crt /etc/haproxy/ssl  
log 127.0.0.1 local1 notice  
option httplog  
reqadd X-Forwarded-Proto:\ https  
reqadd X-Forwarded-Proto:\ http

```
    acl alpha hdr(host) -i alpha.example.com
    acl beta hdr(host) -i beta.example.com
    redirect scheme https if !{ ssl_fc } alpha
    redirect scheme https if !{ ssl_fc } beta
    use_backend alpha-backend if { ssl_fc_sni alpha.example.com }
    use_backend beta-backend if { ssl_fc_sni beta.example.com }

```

backend alpha-backend  
server alpha-server-server 192.168.1.100:8080 check inter 2000 maxconn 500 rise 2 fall 3  
backend beta-backend  
server beta-server-server 192.168.1.200:8090 check inter 2000 maxconn 500 rise 2 fall 3

Here i would like to achieve is if any one tried tried to hit [alpha.example.com/rest/api](http://alpha.example.com/rest/api) it should redirecto to 192.168.1.150:8085 and convert all request to https

Thanks
