# Query string gets lost in url-redirect

**URL:** <https://forum.pritunl.com/t/query-string-gets-lost-in-url-redirect/1432>\
**Category:** Pritunl Zero\
**Created:** [October 4, 2023, 2:03pm UTC](https://forum.pritunl.com/t/query-string-gets-lost-in-url-redirect/1432 "2023-10-04T14:03:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Latorre](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/l/b5ac83/32.png) [@Latorre](https://forum.pritunl.com/u/Latorre)\
**Post date:** [October 4, 2023, 2:03pm UTC](https://forum.pritunl.com/t/query-string-gets-lost-in-url-redirect/1432/1 "2023-10-04T14:03:36Z")

</div>

Good morning, I have the following problem:  
1- A user accesses, for example, [https://mysite.com/data?id=1234](https://mysite.com/data?id=1234)  
2- This user is not logged in pritunl-zero and is redirected to the login page [https://mysite.com/?redirect\_url=%2Fdata](https://mysite.com/?redirect_url=%2Fdata)  
3 - We can see that at the time of redirect\_url the query string ?id=1234 is lost  
4 - If I manually add the query string, it works normally again, validating that the problem is in the redirect\_url.

I would like help to resolve this issue.

Tks!

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [October 4, 2023, 8:00pm UTC](https://forum.pritunl.com/t/query-string-gets-lost-in-url-redirect/1432/2 "2023-10-04T20:00:30Z")

</div>

Currently only the path is included in the redirect URL when logged out. I will look into encoding it into the value in the future.

---

<div class="post-metadata">

**Author:** ![eliel.sardanons](https://forum.pritunl.com/user_avatar/forum.pritunl.com/eliel.sardanons/32/642_2.png) [@eliel.sardanons](https://forum.pritunl.com/u/eliel.sardanons)\
**Post date:** [October 5, 2023, 1:07am UTC](https://forum.pritunl.com/t/query-string-gets-lost-in-url-redirect/1432/3 "2023-10-05T01:07:36Z")

</div>

Thanks, @zach . Is it possible to accelerate this change somehow or get an estimate on when it could be done?

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [October 5, 2023, 7:30pm UTC](https://forum.pritunl.com/t/query-string-gets-lost-in-url-redirect/1432/4 "2023-10-05T19:30:52Z")

</div>

It has been added to the code base and will be in the next release. You could install Git and Go on the server and run the commands below to build the latest code.

```auto
GOPROXY=direct go install github.com/pritunl/pritunl-zero@latest
sudo systemctl stop pritunl-zero
sudo cp ~/go/bin/pritunl-zero /usr/bin/pritunl-zero
sudo systemctl stop pritunl-zero

```

---

<div class="post-metadata">

**Author:** ![eliel.sardanons](https://forum.pritunl.com/user_avatar/forum.pritunl.com/eliel.sardanons/32/642_2.png) [@eliel.sardanons](https://forum.pritunl.com/u/eliel.sardanons)\
**Post date:** [October 5, 2023, 8:04pm UTC](https://forum.pritunl.com/t/query-string-gets-lost-in-url-redirect/1432/5 "2023-10-05T20:04:11Z")

</div>

Thanks! 👏

---

<div class="post-metadata">

**Author:** ![Latorre](https://forum.pritunl.com/letter_avatar_proxy/v4/letter/l/b5ac83/32.png) [@Latorre](https://forum.pritunl.com/u/Latorre)\
**Post date:** [October 5, 2023, 8:12pm UTC](https://forum.pritunl.com/t/query-string-gets-lost-in-url-redirect/1432/6 "2023-10-05T20:12:11Z")

</div>

Thanks for all @zach! 🙌
