Delete verb not working in IIS 8 windows 2012 R2 - windows

Larvel website hosted on Windows server 2012 R2 but I am not able to delete Attachments in the website.
Please refer screenshot now
Error message
Request URL:http://13.232.72.80/api/delete-form-data/form-field/33
Request method:DELETE
Remote address:13.232.72.80:80
Status code:
405
Version:HTTP/1.1
Referrer Policy:no-referrer-when-downgrade
image

Do you want to call asp.net web api with delete method?
If this is your requirement, I suggest you could try below solution to solve this issue.
1.Open your IIS manager and locate the web sites and find the hanlder mapping. Find ExtensionlessUrlHandler-Integrated-4.0, double click it. Click Request Restrictions... button and on Verbs tab, add both DELETE.
2.Remove the WebDAVModule for your web application.
<system.webServer>
<modules>
<remove name="WebDAVModule" />
</modules>
<handlers>
<remove name="WebDAV" />
</handlers>
</system.webServer>

Related

IIS 10 response headers keep reverting after publishing from Visual Studio 2015

I follow something similar to these steps to add CORs to IIS 10 and after about 10 minutes, the response header is removed and CORs stops working.
Open Internet Information Service (IIS) Manager.
Right click the site you want to enable CORS for and go to Properties.
Change to the HTTP Headers tab.
In the Custom HTTP headers section, click Add.
Enter Access-Control-Allow-Origin as the header name.
Enter * as the header value.
Click Ok twice.
Then I go back to Visual Studio and publish my project. Why are my CORs response headers being removed and how do I make them stay?
Thanks to a strong hint from S. Walker, I went onto the server, modified the response header as desired and then looked at the web.config file.
It had added:
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
</system.webServer>
So I copied that into my project web.config file and published. Now it doesn't disappear and CORs continues to work. Seems obvious now.

How to enable CORS on IIS Manager of Windows 10?

I've created an HTTPS server using IIS Manager (Windows 10). Now, I want this server to support CORS requests.
I've read some information. For example,
this link says that I have to create a file web.config in the directory. Unfortunately, it didn't work out.
This link says that I should edit some config files, but I don't find them on my machine.
I had a similar issue recently. Most tutorial/documentation only suggests adding custom headers in the configuration. But this does not tell IIS to handle the CORS Pre-flight request by itself.
To do so, you must install the CORS Module in IIS and add some configuration in the web.config file, as explained here: IIS CORS module Configuration Reference
I recently used this to Reverse Proxy to a REST API and handling the CORS only in IIS so that I don't have to rebuild my project to change CORS settings.
Try to add this into :
<system.webServer>
<modules>
<remove name="WebDAVModule" />
</modules>
</system.webServer>

Publishing MVC site with Visual Studio to IIS 7 removes custom response headers from IIS config

I'm using IIS 7 and I've got a site setup with an additional HTTP response header (X-UA-Compatible header).
I'm deploying an MVC4 project remotely to IIS using the Publish feature in Visual Studio 2010, which uses Web Deploy.
Problem is, every time I publish the site, the HTTP response header gets removed from the config in IIS - is there some way I can prevent this?
I figured it out - when you set headers at the site level in IIS 7, it alters the web.config file. I needed to add a customHeaders element in the web.config file that is deployed:
<system.webServer>
...
<httpProtocol>
<customHeaders>
<add name="X-UA-Compatible" value="IE=edge" />
</customHeaders>
</httpProtocol>
...
</system.webServer>

url loosing extentions on redirection .net

net site on a shared hosted server with plesk as admin panel. And I want my 404 redirected to default page to handle extentionless urls
I have in the plesk panel pointed with url the following.
Error description type location
404 Not found Url http://iservice.iwebdesigner.org
however when I use the url like this http://iservice.iwebdesigner.org/user
it redirects to the default page but looses the /user. I believe the type which is not available on plesk needs to be set to execute url for iis. Is there a way of changing that in plesk? or what else can I do. I am not sure is web config settings can help as iis will have already redirected the page and the extension gone before web config settings can run.
The hosting people say the cant make any changes what so ever to iis.
Thanks
Ok I have figured it out. For those of you trying to use the urlrewriter module
in your shared hosted server. This rule below handles non existent extentionless
url and redirects to default.aspx for processing. e.g www.mysite/user. Once you
have set the 404 error page to point to the default.aspx as above in plesk(Type
must be url and the path set to default.aspx), upload the UrlRewritingNet.UrlRewriter.dll
to your bin folder. in web config
<configsections>
<section name="urlrewritingnet"`enter code here`
requirePermission ="false"
type="UrlRewritingNet.Configuration.UrlRewriteSection, UrlRewritingNet.UrlRewriter" />
</configsections>
<urlrewritingnet rewriteonlyvirtualurls="true" contextitemsprefix="QueryString" defaultpage="default.aspx"
defaultprovider="RegEx" xmlns="http://www.urlrewriting.net/schemas/config/2006/07">
<rewrites>
<add name="ExtensionlessRewrite" virtualUrl="^~/(.*)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="/default.aspx" ignoreCase="true" />
</rewrites>
</urlrewritingnet>
<system.webserver>
<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
</modules>
</system.webserver>
That worked for me echo

server error:405 - HTTP verb used to access this page is not allowed

I have a php Facebook application which I have uploaded in a Microsoft server. When I run the application i get this error. Does anybody know the cause of this ?
405 - HTTP verb used to access this page is not allowed. The page you
are looking for cannot be displayed because an invalid method (HTTP
verb) was used to attempt access.
Even if you are using IIS or apache, in my guess you are using static html page as a landing page, and by default the web server doesn't allow POST or GET verb on .html page, facebook calls your page via POST/GET verb
the solution would be to rename the page into .php or .aspx
and you should be good to go :)
In the Facebook app control panel make sure you have a forward slash on the end of any specified URL if you are only specifying a folder name
i.e.
Page Tab URL: http://mypagetabserver.com/custom_tab/
you can add these lines to the web.config:
<system.webServer>
<modules>
<remove name="WebDAVModule" />
</modules>
<handlers>
<remove name="WebDAV" />
</handlers>
</system.webServer>
It means litraly that, your trying to use the wrong http verb when accessing some http content. A lot of content on webservices you need to use a POST to consume. I suspect your trying to access the facebook API using the wrong http verb.
I fixed mine by adding these lines on my IIS webconfig.
<httpErrors>
<remove statusCode="405" subStatusCode="-1" />
<error statusCode="405" prefixLanguageFilePath="" path="/my-page.htm" responseMode="ExecuteURL" />
</httpErrors>
I've been pulling my hair out over this one for a couple of hours also. fakeartist appears correct though - I changed the file extension from .htm to .php and I can now see my page in Facebook! It also works if you change the extension to .aspx - perhaps it just needs to be a server side extension (I've not tried with .jsp).
Try renaming the default file. In my case, a recent move to IIS7.5 gave the 405 error. I changed index.aspx to default.aspx and it worked immediately for me.
In my case, IIS was fine but.. uh.. all the files in the folder except web.config had been deleted (a manual deployment half-done on a test site).
I got this error when I was using jquery and lib was not present in the given path, once jquery lib is added back error was gone.
[File name - calculate.html]
I had this err on the host too (my project was .net core2.1 webapi )
please add this code in web config in host :
<modules>
<remove name="WebDAVModule" />
</modules>

Resources