IIS URL Rewrite {R:N} clarification

As per the documentation: When an ECMAScript pattern syntax is used, a back-reference can be created by putting parenthesis around the part of the pattern that must capture the back-reference. So taking the example that follows in the documentation: ^(www\.)(.*)$ And using the input string www.foo.com in the conditions, you will have: {C:0} – www.foo.com … Read more

enabling cross-origin resource sharing on IIS7

It is likely a case of IIS 7 ‘handling’ the HTTP OPTIONS response instead of your application specifying it. To determine this, in IIS7, Go to your site’s Handler Mappings. Scroll down to ‘OPTIONSVerbHandler’. Change the ‘ProtocolSupportModule’ to ‘IsapiHandler’ Set the executable: %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll Now, your config entries above should kick in when an HTTP OPTIONS … Read more

IIS7 Overrides customErrors when setting Response.StatusCode?

Set existingResponse to PassThrough in system.webServer/httpErrors section: <system.webServer> <httpErrors existingResponse=”PassThrough” /> </system.webServer> Default value of existingResponse property is Auto: Auto tells custom error module to do the right thing. Actual error text seen by clients will be affected depending on value of fTrySkipCustomErrors returned in IHttpResponse::GetStatus call. When fTrySkipCustomErrors is set to true, custom error … Read more

IIS7 Cache-Control

If you want to set the Cache-Control header, there’s nothing in the IIS7 UI to do this, sadly. You can however drop this web.config in the root of the folder or site where you want to set it: <?xml version=”1.0″ encoding=”UTF-8″?> <configuration> <system.webServer> <staticContent> <clientCache cacheControlMode=”UseMaxAge” cacheControlMaxAge=”7.00:00:00″ /> </staticContent> </system.webServer> </configuration> That will inform the … Read more

Only one configSections element allowed per config file and if present must be the first child of the root configuration element

The error message itself actually details the correct fix: configSections must be the first child* of the root element: *emphasis added So just move the configSections to the top: <configuration> <configSections> <section name=”Reva.Properties.Settings” type=”System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ requirePermission=”false” /> <section name=”log4net” type=”log4net.Config.Log4NetConfigurationSectionHandler, log4net” /> </configSections> <startup useLegacyV2RuntimeActivationPolicy=”true”> <supportedRuntime version=”v4.0″/> </startup> </configuration>

double escape sequence inside a url : The request filtering module is configured to deny a request that contains a double escape sequence

The security holes that you might open up have to do with code injection – HTML injection, JavaScript injection or SQL injection. The default settings protect you from attacks semi-efficiently by not allowing common injection strategies to work. The more default security you remove, the more you have to think about what you do with … Read more

IIS7 Settings File Locations

It sounds like you’re looking for applicationHost.config, which is located in C:\Windows\System32\inetsrv\config. Yes, it’s an XML file, and yes, editing the file by hand will affect the IIS config after a restart. You can think of IIS Manager as a GUI front-end for editing applicationHost.config and web.config.

MsDeploy is returning 403 forbidden

If you go into IIS, Click on the server node in the “Connections” list, Double click “Management Service” then you are taken to a screen which has an “Enable remote connections” check box. This checkbox (and the rest of the sreen) maybe greyed out because the service is running. Just click the “Stop” link in … Read more

How to set the maxAllowedContentLength to 500MB while running on IIS7?

The limit of requests in .Net can be configured from two properties together: First Web.Config/system.web/httpRuntime/maxRequestLength Unit of measurement: kilobytes Default value 4096 KB (4 MB) Max. value 2147483647 KB (2 TB) Second Web.Config/system.webServer/security/requestFiltering/requestLimits/maxAllowedContentLength (in bytes) Unit of measurement: bytes Default value 30000000 bytes (28.6 MB) Max. value 4294967295 bytes (4 GB) References: http://www.whatsabyte.com/P1/byteconverter.htm https://www.iis.net/configreference/system.webserver/security/requestfiltering/requestlimits Example: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)