0

I have created a redirect rule in my web.config in order to redirect my website from http to https. I published my website on my staging and it was working perfectly. After some manipulation in my web.config, i published again my website and now i have a HTTP 500 error. I tried to undo those modification and set my web.config as it was and i still have that error. I tried everything as well as deleting my web.config and create a new one but it seems that the manipulation i did has crushed my staging and i am not able to make it work again.

This is my web.config before redirection:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <system.webServer> 
        <handlers>
          <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
        </handlers>
        <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false">
       </aspNetCore>
    </system.webServer>
  </configuration>

This is what i added for redirecting my http to https and it was working perfectly.

<rewrite>
  <rules>
    <rule name="HTTP to HTTPS redirect" stopProcessing="true">
      <match url="(.*)" />
      <conditions>
        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
      </conditions>
      <action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
    </rule>
  </rules>
</rewrite>

Then i made some manipulation and change the action input {HTTP_POST} to my domain name. While it is working locally, my staging is not working anymore and i tried to undo everything but i still have the HTTP 500. What should i do?

Huby03
  • 801
  • 2
  • 14
  • 28
  • And there is really no error message, stack trace or anything, just the code 500? – Sami Kuhmonen Apr 10 '17 at 12:18
  • Yes only the HTTP 500! – Huby03 Apr 10 '17 at 12:20
  • No i haven't! But yet my redirection was working well in the beginning – Huby03 Apr 10 '17 at 12:22
  • @Huby03: Did you check if your SSL certificate is still valid and anything is not changed on that front like expiry date etc? – Pankaj Kapare Apr 10 '17 at 12:24
  • SSL is still valid on the production server as well as the staging, i bought it few days ago – Huby03 Apr 10 '17 at 12:25
  • check this answer : http://stackoverflow.com/questions/5385714/deploying-website-500-internal-server-error/5385884#5385884 – Aristos Apr 10 '17 at 12:32
  • Please post your `controller` here. I guess you're using `[Authorize]` in your `controller`. – MUT Apr 10 '17 at 12:38
  • @MUT No i am not using [Authorize] and my controllers didn't change at all. The only change i made was in my web.config as stated above – Huby03 Apr 10 '17 at 12:41
  • @Huby03 what are other error messages or stack trace as mentioned early in comment? Which IIS version you're using? – MUT Apr 10 '17 at 12:46
  • Read [this](http://stackoverflow.com/questions/5385714/deploying-website-500-internal-server-error). May be you'll find solution. – MUT Apr 10 '17 at 12:51
  • @MUT IIS10 and no error messages, only a blank page with HTTP 500 error. I am right now deleting manually all files in my staging and will try to re-publish and check Aristos solution. – Huby03 Apr 10 '17 at 12:51

0 Answers0