Questions tagged [web.config]

A configuration file for ASP.NET web applications in XML format.

Filter by
Sorted by
Tagged with
71 votes
6 answers
244k views

IIS complains about a locked section - how can I find out where it's locked?

I have this section in my web.config: <system.webServer> <modules runAllManagedModulesForAllRequests="true" /> <security> <authentication> <...
Michael Stum's user avatar
  • 4,070
18 votes
4 answers
37k views

IIS7 - Lock Violation error, HTTP handlers, modules, and the <clear /> element

I have an ASP.NET site that uses its own set of HTTP handlers and does not need any modules. So, in IIS6, all I had to do was this in my web.config: <httpModules> <clear /> </...
Daniel Schaffer's user avatar
17 votes
2 answers
18k views

Prevent URL Rewrite rules from being inherited by subdirectories in IIS7

I have a URL Rewrite setup for clean URLs in a CMS and my web.config looks like this: <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <...
Rich Jenks's user avatar
15 votes
4 answers
59k views

IIS7: How to block access with a web.config file?

I know that IIS7 allows me to have a per directory configuration with the web.config xml file. I have a directory with some configuration files that don't want to be web accessible. A local web.config ...
neves's user avatar
  • 1,270
11 votes
4 answers
12k views

Could you tell me what exactly happens when we edit the Web.config (at runtime) on a IIS server?

Could you tell me what exactly happens when we edit the Web.config (at runtime) on a IIS server. Is the application that depend of the web.config automatically restarted? If yes is it possible to ...
Bastien Vandamme's user avatar
9 votes
4 answers
69k views

How to configure a Web.Config file to allow custom 404 handling while still displaying on-page 500 error detail?

To customize 404 handling and based on the hosting company's suggestion, we are currently using the following web.config setup. However, we quickly realized that with this configuration, any page ...
user avatar
9 votes
1 answer
16k views

The configSource file 'connections.config' is also used in a parent, this is not allowed.

Question: I face the following situation: A ASP.NET .NET 4.0 web-application deployed on machine "vmsomething". The web-application running on IIS 7.5 resides in d:\webs\myapplication on ...
Quandary's user avatar
  • 1,024
9 votes
3 answers
13k views

Need help with some IIS7 web.config compression settings

I'm trying to configure my IIS7 compression settings in my web.config file. I'm trying to enable HTTP 1.0 requests to be gzip. MSDN has all the info about it here. Is it possible to have this config ...
Pure.Krome's user avatar
  • 6,608
7 votes
2 answers
5k views

Application Settings outside of web.config

I need to keep the production app settings section outside of Web.config; I don't want keys and other secret information to be kept inside source code repository. However, if I edit the app settings ...
Mircea Chirea's user avatar
6 votes
6 answers
17k views

Javascript Errors only on Production Server?

I am in the process of releasing a couple of asp.net websites from development to production. Everything seems to be working fine in development, but upon the release to production we get a number of ...
ChrisHDog's user avatar
  • 243
5 votes
2 answers
2k views

Basic HTTP Authentication in IIS

Forgive my lack of IIS experience, but I have a user on a hosted server running IIS with Plesk. He uses protected folders, and I'm looking for a way to: Allow him to protect folders using a simple ...
Aksival's user avatar
  • 161
5 votes
2 answers
4k views

IIS Application Initialization isn't running even though all settings are configured

The end goal is to make it so that whenever my app pool is recycled (which should happen whenever I release an update for the site), my site gets visited once to "warm up". Typically the first visit ...
Coder7862396's user avatar
4 votes
1 answer
2k views

Web.config modification to block search engines from crawling pdfs

I'm trying to stop web crawlers from indexing pdf files on a website. I know how to do this with an .htaccess file but not in a web.config file. This snippet will stop crawlers from indexing the whole ...
robb's user avatar
  • 145
4 votes
1 answer
3k views

Why can't IIS read Web.config within a folder created by Bash on Windows?

If I use bash (from Ubuntu 18.04 running via Windows Subsystem for Linux) to create a directory under my Windows profile: $ mkdir /mnt/c/Users/mdmower/source/repos/WebBash then IIS 10 is unable to ...
MDMower's user avatar
  • 186
4 votes
3 answers
4k views

How to forbid usage of web.config files?

I have a Windows 2008 R2 server with IIS7.5 installed. I need to provide users with read-write access to some directory tree via WebDAV. The same users will also be able to reach the same directories ...
Cat Mucius's user avatar
4 votes
1 answer
1k views

Use appcmd.exe to enable gzip compression on dynamic content on IIS 7.x

Every doc I can find discusses editing applicationHost.config in notepad to enable this. The real need: a) Via appcmd.exe or cmd line tool, enable dynamic compression to be configured in web.config (...
Jonesome Reinstate Monica's user avatar
4 votes
0 answers
385 views

Shared Configuration and AppSettings

We use Shared Configuration for our IIS config, so the same config is used by the webservers. This works well. We like to share some server-level <AppSettings> between the servers. (in IIS ...
Julian's user avatar
  • 93
4 votes
1 answer
1k views

Restrict access to a subdomain with web.config on IIS7?

I need to password protect a "dev" subdomain on a server with the web.config file on IIS7. I don't have access to anything besides the files and web.config, so I can't install modules or anything else ...
Brett's user avatar
  • 41
4 votes
0 answers
928 views

How can I password protect an IIS directory with only FTP access?

How can I password protect an IIS directory when I only have FTP access to the server? I can't adjust any IIS settings or add users or anything like that. The answer to: IIS Basic Authorization ala ...
Tony Adams's user avatar
4 votes
0 answers
1k views

IIS7 proxying VisualSVN server refuses to allow Web.config files to be committed

I use IIS 7.5 with the Application Request Routing and URL Rewriting modules to act as a reverse proxy for several apache-based web sites, including VisualSVN Server. I'm having a problem when I try ...
Tim Long's user avatar
  • 1,738
3 votes
4 answers
13k views

Enabling Brotli compression on IIS

My team us currently trying to install Brotli compression on a VPS: Windows Server 2012 R2 with IIS8.5 using the 64bit module that can be downloaded here: https://www.iispeed.com/pagespeed/products/...
Adam's user avatar
  • 287
3 votes
2 answers
4k views

Block directory access in IIS but allow specific file through

Is it possible to block access to a directory through the web.config in IIS (excluding a small set of IPs) but allow through one specific file for everyone. The reason I ask, I want to block the wp-...
chrisd's user avatar
  • 81
3 votes
1 answer
2k views

server response tags

if a server response header is added to a config file of a site, does it display in IIS 7 as a server response header? I am having a problem where a no index response header (tag) is repeatedly being ...
Andy Smith's user avatar
3 votes
2 answers
5k views

Add Website Host name - should I include www prefix?

When adding a new website to IIS, the Binding section requires the host name, and gives an example as: Example: www.contoso.com or marketing.contoso.com When creating my website for zuggler.com, ...
Jonathan Wood's user avatar
3 votes
1 answer
4k views

IIS seems to think I have duplicate Custom Headers defined; complains about it

I am a software developer and I debug a website on my local machine in IIS 7.5. Recently I experienced problems with my machine that would not go away, so I backed up, formatted, resintalled Windows ...
CodeWarrior's user avatar
3 votes
1 answer
231 views

file change auditing (especially for web.configs)

We occasionally have configurations in web.config(s) being changed by the IT team on live production servers. I would like to create an audit trail, e.g., "On October 11 the property "foo" in file "...
mhenry1384's user avatar
3 votes
1 answer
1k views

IIS 7 Redirect from HTTP to HTTPS fail with ampersand in URL

IIS 7 on Windows Server 2008 R2 SP1 I have added the following rule to my web.config to redirect all incoming request to HTTPS <rule name="HTTP to HTTPS redirect" stopProcessing="true"> <...
David Buell's user avatar
3 votes
1 answer
6k views

IIS web.config Old URL to New URL redirects

I'm new to redirects and having a hard time getting these to work, I have about 1400 URL's from an old site that need to redirect to a new site, same domain name, but different folders and domain ...
user221535's user avatar
3 votes
0 answers
2k views

application/json content doesn't get gzip'ed with IIS

We have some rather lengthy AJAX calls in our app, some of which transmit over 100k of data across a rather slow encrypted network. I'd like to enable G-Zip compression on application/json to speed ...
Mike Christensen's user avatar
2 votes
1 answer
4k views

customErrors="RemoteOnly" not working properly in Server 2008

It would appear that on my brand new Windows Server 2008 with IIS7, customErrors is not working. We have customErrors set to RemoteOnly in the web.config on our Asp.Net sites and applications. ...
Armstrongest's user avatar
2 votes
1 answer
919 views

IIS10 not saving (all) configuration details to site's web.config

The web.config on a fresh IIS install contains the sites configuration details, except for <ipSecurity>. However, the (site local) IP restrictions work fine and can be edited through the IIS ...
bjoster's user avatar
  • 4,917
2 votes
1 answer
9k views

IIS access control by IP address for specific files and folders

I am pretty new to IIS and I want to secure access to a management console of a web app. By design of application there's a virtual directory that's intended for public access, but at the same time ...
Alex's user avatar
  • 516
2 votes
1 answer
4k views

Is there any way to disable an ISAPI filter at the application (NOT site) level in IIS 7.5?

We have a number of applications running under a single IIS site, but one needs to run in a 32-bit application pool due to an old library it uses. However, we can't currently do this because there ...
Mark Bell's user avatar
  • 308
2 votes
1 answer
2k views

IIS returns 404 when trying to access static files on certain file types

I have a specific file type of .notebook that IIS is blocking. I tried going into request filtering and adding .notebook with allow set to true, but I still get the 404. Anything else in this folder ...
Jhorra's user avatar
  • 123
2 votes
1 answer
4k views

PHP error_log function not working after upgrading to IIS 7.5

I'm using error_log which has been working fine for years under IIS 6. Recently I upgraded to IIS 7.5 (Windows 7) and the messages logged by error_log stop appearing. In fact nothing is going to the ...
Al Henderson's user avatar
2 votes
1 answer
2k views

should the same machine key be used in development and production environments?

Our production servers all have the same machine key. However, our production and development systems do not have identical machine keys. We get heaps (about one per second) of exceptions of the form ...
Henry Troup's user avatar
2 votes
1 answer
354 views

Redirect in web.config because of certificate issues

I'm running some websites on a IIS 7.5 with one UCC SSL certificate, where 10 domains are secured. most of them are something.company.ch, some are something.anothercompany.ch we have a redirect rule ...
SimonS's user avatar
  • 787
2 votes
2 answers
7k views

Is there a cmd tool to check a web.config file for validity?

When you have a malformed web.config and try and edit part of it in the GUI it will popup a box saying so and telling you the line it broke on. Is there a way to access this functionality thought the ...
Gilsham's user avatar
  • 123
2 votes
1 answer
2k views

HTTP Error 500.19 - IIS Error

I have following lines in my web.config file. All I am trying to achieve is to display a custom error page if anything goes wrong in application. But instead of getting the custom page I get error as ...
bp581's user avatar
  • 141
2 votes
1 answer
4k views

IIS ignoring mime-type settings and serving file as application/octet-stream

We added both handlers and mime-types for IIS in the web.config to tell the server how to handle the different types of audio and video files we are using on the site. IIS does not seem to be ...
LocalPCGuy's user avatar
2 votes
2 answers
5k views

How to actually set max-age headers on Windows Server?

I've set the max age to 1 minute, but when I look at the response headers, I see max-age=86400 (one day). Is something else overriding this setting? I've also set the kernel cache to 1 minute for ...
FlavorScape's user avatar
2 votes
1 answer
1k views

Configuring WordPress rewrite rules on IIS7.5 inside virtual application

I have to configure WordPress into a virtual application under a principal website running on ASP.NET 2.0 Classic mode. Everything is working fine, PHP 5.3.13 / MySQL 5.1 / IIS 7.5, the wordpress ...
Marc-Andre R.'s user avatar
2 votes
1 answer
7k views

Can I configure IIS to use the same physical path for different sites but use custom web.config

First, let me provide you with the outcome I'd like to see. I unbundle my "application" (pages, code and assemblies) once into a directory. I use the same application (pages, code and assemblies) to ...
Ajaxx's user avatar
  • 125
2 votes
0 answers
858 views

Is there a way i can track which IIS server redirects are being used

Our web.config file has 1300 redirects in it and growing all the time. Its a mixture of 4 site rebuilds over 15 years and marketing vanity URLS. My question is 3 part. does having to search through ...
PJSANTA's user avatar
  • 21
2 votes
0 answers
29 views

Manage passwords stored in web configs located on a server

We have a number of servers that perform different functions and every 60 days we do password refreshes. Normally this isn't an issue but we have these passwords stored in web configs all over the ...
LearningCSharp's user avatar
2 votes
2 answers
106 views

Two website with SSL on NGINX. Sequence and redirect

I have two website with SSL on NGINX. When curl -I https://www.1111.com answer: https://1111.com But when curl -I https://www.2222.com answer: https://1111.com curl -I https://2222.com answer ...
Yarik Bright's user avatar
2 votes
0 answers
311 views

IIS https to https

I am trying to use IIS rewrite module to redirect https to another https. This is what i have tried: test 1: <rewrite> <rules> <rule name="Redirect Maps Rule" ...
Barnsley's user avatar
2 votes
0 answers
286 views

ASP.NET application impersonate user with netonly to access network share

We have an ASP.NET application running on Server A which is on its own domain, in the web.config we are impersonating a user. Now this application needs to access a folder on Server B which is on a ...
Ray's user avatar
  • 159
2 votes
1 answer
6k views

ASP.NET MVC Getting Error 504 after 10 minutes of File Upload

I have an ASP.NET MVC2 Web application, working with SQL Server 2008 R2, running with IIS 6.2. I have a functionality where one particular admin needs to upload about 5000 documents, which then get to ...
SantLev's user avatar
  • 23
2 votes
1 answer
239 views

Apache 2.4 nasted location with exeptions

I have a problem with my apache2.4 configuration. I have multiple services served by the apache reachable through: www.example.com/http-service/ -> proxy pass config www.example.com/webservice2/ -> ...
tingel2k's user avatar
  • 131