The user tpavliuk is experiencing an issue with external links in posts on their Discourse forum installed in a subfolder (https://i.materialise.com/forum/). When a user clicks on an external link, they are redirected to a URL with the main site domain, instead of the original URL.
tpavliuk has investigated the issue and found that it is caused by a ServiceWorker redirect with a 302 status code. However, Falco discovered that the issue persists even when ServiceWorkers are disabled, suggesting that it is a problem with the reverse proxy configuration.
After further investigation, Falco used a curl command to test the issue and found that the problem is likely caused by the IIS reverse proxy configuration. RGJ suggested that the issue might be related to a known problem with IIS URL rewriting.
In the end, tpavliuk was able to find and fix the problem, which was caused by a misconfiguration in the Application Request Routing settings in their IIS.
We have forum installed in subfolder: https://i.materialise.com/forum/
We have problem with external links in posts. When user clicks on external link, he gets redirect to URL with our main site domain with path and query string from original URL, but not to original URL.
For example:
User gets https://i.materialise.com/watch?v=%3cvideo_id, instead of original link to Youtube: https://youtube.com/watch?v=%3cvideo_id)
And this behavior reproduces for any external links. Open in new tab via context menu and mouse middle button click works well.
I did some investigation and found that on click on link, we call, for example: https://i.materialise.com/forum/clicks/track?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dk-r-zmItM0Q and ServiceWorker redirects us to URL https://i.materialise.com/watch?v=k-r-zmItM0Q with status code 302. I spent a lot of time on this forum and didn`t find any idea what can be wrong with settings.
We have many complaints from community members and I will be very appreciate for any assistance or advice how to solve this problem.
Are you running latest? Can you link us to a particular post exhibiting the problem? @Falco are you aware of any subfolder issues with the link tracker?
@sam, we are running latest version 2.0.0.beta4 +78. We updating our instance regularly. We are live with mentioned problem for some time with different versions.
Live post with problem is here: https://i.materialise.com/forum/t/tritangle-by-oskar/388
@Falco, yes, I setted up my instance according to mentioned guide.
That sounds a lot like this issue although I don’t think it’s exactly the same. Apparently IIS is decoding the URLencoded part first, and then replacing everything in front of the last ?
Can you post the relevant part of your IIS configuration here?
Guys, thanks a lot to everyone for help. Your posts directed me to different investigations and I found problem and fixed it.
Problem was in Application Request Routing configuration in our IIS.