Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sprite 18 posts 158 karma points
    Nov 12, 2020 @ 14:29
    Sprite
    0

    Redirect checker returns 500 internal error on homepage

    Hello,

    We have an umbraco environment running on our own server.

    But we have an issue that we can't find out how or why.

    Using the following site we use to check for redirections: https://www.redirect-checker.org/index.php

    When i enter: https://ontherock.nl/

    it returns an 500 error. However the page is perfectly working for everyone that goes to the site. Also it only happens on the homepage.

    Other pages are fine with this checker. And things like gtmetrix and google pagespeed have no issue with the homepage either.

    Does anyone got an idea why this could happen?

  • Steve Morgan 1346 posts 4453 karma points c-trib
    Nov 12, 2020 @ 17:45
    Steve Morgan
    101

    Hi,

    You tickled my intrigue here... I'm guessing you're doing something with the users' browser request headers to redirect to NL / EN versions of the site?

    The spiders and redirect tools probably aren't setting the user agent / accepted language header or something that you're relying on and it's throwing an error.

    I tried to work out what it was but ran out of time.. I can emulate this error using Powershell and Invoke-WebRequest (it can write the html response to a file).. here's how far I got with a command to pass the accept language header seeing if I could get a successful payload back, hopefully this is useful to you!

    I think the fix you need is to look at the IIS module / redirect code that's doing the language match. It needs to be made a bit more solid if this info is missing in the request - probably defaulting to one of the sites. There's a chance some website crawlers might hit this 500 so you probably want to look into it.

    Invoke-WebRequest -Uri "https://ontherock.nl/" -Headers @{"Accept-Language"="en-us,en;q=0.5"}  -OutFile "C:\Users\steve\Desktop\_scratch\wget"
    

    HTH and at least points you in the right direction!

    Steve

  • Sprite 18 posts 158 karma points
    Nov 13, 2020 @ 13:14
    Sprite
    0

    Hello Steve,

    Thank you for answering to this question!

    With the information you had provided i was able to look a bit further into the issue. And i have finally found it.

    I am using webp format on images for optimalisation. However since not every browser accepts webp format i had to build in some kind of check. And unfortunate it went wrong on that location.

    The check i had was as following: if(Request.AcceptTypes.Contains("image/webp"))

    For a quick fix i have placed an try and error around it. And the response after this fix was the correct 200.

    So thanks alot for pointing me in a right direction!

  • Steve Morgan 1346 posts 4453 karma points c-trib
    Nov 13, 2020 @ 16:28
    Steve Morgan
    0

    Ah! Great stuff.

    Glad it helped - I jumped to a conclusion with the language but I'm glad it at least got you there.

    Steve

Please Sign in or register to post replies

Write your reply to:

Draft