# How to use reqirep with https requests?

**URL:** https://discourse.haproxy.org/t/how-to-use-reqirep-with-https-requests/2710
**Category:** Help!
**Created:** [July 9, 2018, 2:39pm UTC](https://discourse.haproxy.org/t/how-to-use-reqirep-with-https-requests/2710 "2018-07-09T14:39:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jurgenhaas](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jurgenhaas](https://discourse.haproxy.org/u/jurgenhaas)
#### Post date: [July 9, 2018, 2:39pm UTC](https://discourse.haproxy.org/t/how-to-use-reqirep-with-https-requests/2710/1 "2018-07-09T14:39:51Z")

</div>

I’m using the following instruction which works just fine for http requests:

```auto
reqirep ^([^\ :]*)\ /.*([a-z][a-z]-[a-z][a-z]).pdf \1\ /\2/404 if needsredirect !ischina

```

But for https requests this generates a `HTTP/1.1 400 Bad Request` and I can’t figure out how to get this to work. Any help much appreciated.
