Copied to clipboard

Flag this post as spam?

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


  • bh 444 posts 1544 karma points
    Jul 31, 2024 @ 14:33
    bh
    1

    ApiError Method Not Allowed v14.1.1

    After publishing my v14.1.1 site to my sever I can't Save or Save & Publish anything. I get a red notification: "ApiError Method Not Allowed".

    I have the DeliveryAPI enabled. All of my Content is there in Umbraco...but when I try to access the DeliveryAPI: https://mydomainhere/umbraco/delivery/api/v2/content/

    I get: {"total":0,"items":[]}

    I've looked in the log file. I don't see anything that looks like it coincides with this error.

  • bh 444 posts 1544 karma points
    Jul 31, 2024 @ 17:42
    bh
    100

    Figured it out thanks to this 9 yo forum post: https://our.umbraco.com/forum/umbraco-7/using-umbraco-7/60809-405-Method-Not-Allowed-when-login-attempt

    I had this rewrite rule in my web.config:

    <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>
    

    Per @FrankNeitzel I modified my rewrite to this and everything is hunky dory.

    <rewrite>
            <rules>
              <rule name="HTTP to HTTPS redirect" stopProcessing="true">
                <match url="(.*)" />
                <conditions>
                  <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                  <add input="{REQUEST_URI}" pattern="^.*/umbraco" negate="true" />
                </conditions>
                <action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
              </rule>
            </rules>
          </rewrite>
    
  • hakan 24 posts 118 karma points
    Aug 06, 2024 @ 20:57
    hakan
    0

    it couldn't solve. I still get same problem. I get this error form PUT,DELETE,POST requests.

  • hakan 24 posts 118 karma points
    Aug 06, 2024 @ 21:04
    hakan
    0

    finally that solved my problem

    <location path="." inheritInChildApplications="false">
        <system.webServer>
            <handlers>
                <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
            </handlers>
            <aspNetCore processPath="dotnet" arguments=".\NicheLifes.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
        </system.webServer>
    </location>
    <system.webServer>
    
        <rewrite>
            <rules>
                <rule name="HTTP to HTTPS redirect" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                        <add input="{REQUEST_URI}" pattern="^.*/umbraco" negate="true" />
                    </conditions>
                    <action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
                </rule>
            </rules>
        </rewrite>
    
        <modules runAllManagedModulesForAllRequests="false">
            <remove name="WebDAVModule" />
        </modules>
    
        <httpProtocol>
            <customHeaders>
                <clear />
                <add name="Access-Control-Expose-Headers " value="WWW-Authenticate"/>
                <add name="Access-Control-Allow-Origin" value="*" />
                <add name="Access-Control-Allow-Methods" value="GET, POST, OPTIONS, PUT, PATCH, DELETE" />
                <add name="Access-Control-Allow-Headers" value="accept, authorization, Content-Type" />
                <remove name="X-Powered-By" />
            </customHeaders>
        </httpProtocol>
        <security>
            <requestFiltering>
                <requestLimits maxAllowedContentLength="524288000"/>
            </requestFiltering>
        </security>
    </system.webServer>
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies