# Modify requested URL

**URL:** <https://discourse.haproxy.org/t/modify-requested-url/6756>\
**Category:** Help!\
**Created:** [July 25, 2021, 12:51pm UTC](https://discourse.haproxy.org/t/modify-requested-url/6756 "2021-07-25T12:51:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![heribert](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@heribert](https://discourse.haproxy.org/u/heribert)\
**Post date:** [July 25, 2021, 12:51pm UTC](https://discourse.haproxy.org/t/modify-requested-url/6756/1 "2021-07-25T12:51:05Z")

</div>

Dear all,

I’m running haproxy on an opnsense system, which works fine.As one backend I’m using xwiki. This system is on part 8080.  
All is working fine to have access through the frontend with https//wiki.mydomian.com.  
All http request are redirected to https (443) . Also the ssl certificate is properly in place

However there is one strange thing: In the case the user has forgotten the password he gets an email after filling like this  
[https://wiki.mydomain.com:80/bin/view/XWiki/ResetPasswordComplete?u=](https://wiki.mydomain.com:80/bin/view/XWiki/ResetPasswordComplete?u=)…  
The strange thing is the https at the beginning, which is correct and the port :80 at the end.

The browser reports an error like : SSL\_ERROR\_RX\_RECORD\_TOO\_LONG

If I manually delte the “:80” from the link all is working fine.

How can I modify/rewrite the requested url and delte the :80

Any help is appreciated

---

<div class="post-metadata">

**Author:** ![heribert](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@heribert](https://discourse.haproxy.org/u/heribert)\
**Post date:** [August 1, 2021, 8:17pm UTC](https://discourse.haproxy.org/t/modify-requested-url/6756/2 "2021-08-01T20:17:22Z")

</div>

This worked for me:  
In the frontend (advanced mode= in the sectio **Option pass-through**  
add:  
http-request replace-value Host (.\*):80 \1:443

---

<div class="post-metadata">

**Author:** ![Rfraile](https://avatars.discourse-cdn.com/v4/letter/r/50afbb/32.png) [@Rfraile](https://discourse.haproxy.org/u/Rfraile)\
**Post date:** [August 6, 2021, 6:11pm UTC](https://discourse.haproxy.org/t/modify-requested-url/6756/3 "2021-08-06T18:11:35Z")

</div>

I remember readed in some RFC that the port after the hostname is optional, but the facto standard is to avoid it, nowadays in 443 too.

There are some questions about this subject before, the accepted way seems:

`http-request set-header host %[hdr(host),field(1,:)]`
