Seems like with the default settings, a newly created virtual directory does not serve the default files it contains. How can I enable this?
app <- .net app available at domain.com/
/virtualdir/index.htm <- default file in a virtual directory
I would like to make it possible for requests to domain.com/virtualdir to serve domain.com/virtualdir/index.htm
Currently domain.com/virtualdir/index.htm works as desired, but domain.com/virtualdir returns a 404.
Any ideas? I think I might need to add something to a webconfig file in virtualdir but not quite sure what. index.htm is already in the list of default documents.
Detailed Error Information:
Module ManagedPipelineHandler
Notification ExecuteRequestHandler
Handler ek*
Error Code 0x00000000
Requested URL http://localhost:80/virtualdir/
Physical Path C:\inetpub\extras\virtualdir\
Logon Method Anonymous
Logon User Anonymous
Related
We have a "Resources" virtual directory which is mapped to an NFS folder.
We also have a rewrite rule which is triggered on specific requests to "Resources\Images..." which redirects to a different url. This new url is then then handled by routing.
All other requests to the "Resources[any other folder + filename]" are all served by IIS as expected.
Note: We also have an additional handler which is directing urls that include a file entension to the routing handler (IIS automatically captures requests with filename and extension).
Under normal circumstances this is working fine. The problem is that sometimes the NFS folder becomes unavailable and the result is that IIS appears to then try to access a web.config file from within the "Resources" virtual directory. The virtual directory does not have a web.config file in it. The request ultimately times out and with a 500.19 error.
We were hoping that any requests to "Resources\Images..." would still be processed by the rewrite rule, but IIS is not letting it get this far and is first trying to load a web.config file (for any requests to the "Resources" folder), which is not available and then just times out with the 500.19 error.
Within the applicationHost file we have tried setting the virtualDirectoryDetaults.allowSubDirConfig to false at the root level, and also at many other levels including on the virtual directory itself and this does not stop IIS from trying to load a web.config file from the virtual directory.
Is there any other way to stop IIS from trying to load a web.config file from a virtual directory? Or is there any way to ensure that the rewrite rules are triggered before IIS tries to inspect the directory?
I have a simple azure web app and have set the default document in the portal to home.aspx. There is a home.aspx file published, it is browsable via http://my-domain.azurewebsites.net/home.aspx (not real domain) however the default document won't work when browsing to http://my-domain.azurewebsites.net it returns a 404. There is nothing special here. I even added it to the web.confg and it still returns a 404. It is a web forms project, set to integrated security with the correct default document added. Any ideas?
I setup the following web app (West): supportforlucuma There is only one other app in that plan which is the one that isn't working.
I can see the home.html page by visit “http://supportforlucuma.azurewebsites.net/”, Is your issue solved? If no, I will provide more information of how to debug this issue.
Except to set default document on portal and web.config, the default document also could be set in RouteConfig.cs file. For example, following code will set the index.aspx as the default page of current web application and it has the highest priority. If index.aspx file is not exist, a 404 error will response to client. Please check whether the similar code is exist in RouteConfig.cs file.
routes.MapPageRoute("default", "{page}", "~/{page}.aspx",false,new RouteValueDictionary( new { page = "index" }));
For further troubleshooting this issue, we can to get the detail information of 404 response. For example, which modules are executed on server side during the default page is accessed. To do it, we need to enable Failed request tracing. Then we could see the detail information by download the tracing log from LogFiles folder. For example, "ftp://xx.ftp.azurewebsites.windows.net/LogFiles/W3SVC355162095/".
I am getting this following issue. What can be possible reason.
The requested page cannot be accessed because the related configuration data for the page is invalid.
For me all I did was delete the file web.config . However, my serverside was ColdFusion which has in-built functionality to do a deepsearch of web.config starting from the parent directory to the internal ones. so I had a web.config file in one of the inner directories.
I was getting "HTTP 403 error Microsoft Edge can’t get to this page", while launching an application from IIS in Windows 10. Please suggest a solution for this.
thanks
If all permissions are set and even though your website shows 403 forbidden, most likely the default page is not set for your website. With IIS, you can configure the default document as follows.
Connect to IIS.
Expand the sites and select the desired website.
From right hand side feature view, click on Default Document.
Set your desire default page and save the settings.
While you browse any website, IIS searches for the default page to be displayed. If the first default document is not available, IIS will look for the next default page from the list. When IIS is unable to find any match and directory listing is enabled for that particular website, IIS will show you the list of folders. If directory listing is disabled, IIS will return an HTTP Error 403 - Forbidden message to the browser.
If an empty application gives you a 403 I can think of two immediate reasons.
The permissions are wrong. You might need to give the application pool user (IIS AppPool\NAMEOFAPPPOOL with recommended configuration) read permission to the directory.
You don't have any content. If you try to access a directory in IIS you will get a 403. Add a file and try to access that directly, or a Default.aspx or index.html file to the directory you're trying to access.
I want to reference a javascript file at the bottom of a page template.
I added the .js file under cmssitemanager / development / javascript files and then added the following to the master template (portal engine):
<script src="/CMSScripts/Custom/FOO/BAR.js"></script>
When I open the page in any browser, the javascript in the file isn't executing.
When try to access the file directly in the browser at domain.com/CMSScripts/Custom/FOO/BAR.js I get redirected to the Kentico logon page.
I don't see how/where I can specify security for the CMSScripts directory, but the user should not have to be logged in to access this file.
Any suggestions?
Update with info from first answer:
We are not currently using Windows Authentication, and I verified that the application pool user account has file-system permissions. I also verified that the application can add/delete/modify files using the cmssitemanager > administration > system > files > "test files" utility which resulted in OK status for creating/deleting/modifying folders and files.
I do have Check files permission checked in cmssitemanager > settings > system > files > security. Unchecking this option does not change the behavior, including after restarting both the application and the windows services.
The site is valid and has the correct license however there was NOT a domain alias defined. I added one however this did not change the behavior.
We have not made any changes to the web.config save for connection string information. If you are referring to this documentation on CMSUseTrailingSlashOnlyForExtensionLess in the web.config, this was not previously in there however adding it did not change anything. To that end, I wasn't seeing the site trying to redirect to domain.com/CMSScripts/Custom/FOO/BAR.js/ so I truly think it's tied to some kind of security ACL that is out of order.
Here is the solution provided by user FroggEye on the Kentico DevNet forum thread on this same issue:
You're best bet is to use the syntax below. Kentico does URL processing on all directories unless excluded and you'd have to exclude the CMSScripts directory from processing which isn't hard but the code below is a better solution.
<script src="/CMSPages/GetResource.ashx?scriptfile=/CMSScripts/Custom/FOO/BAR.js" type="text/javascript"></script>
This will do 2 things:
give you a standard place to call resources from (you can get stylesheets here as well)
allow you to use the build-in minimization functions.
Charles,
This is a strange behavior, it does not normally do that.
Do you have any windows auth going on ? where you possibly removed anonymous access (in IIS) to directories in the website folder ?
Do you have Check Files permissions turned on as a Kentico Site setting? (even though I'm fairly sure that won't affect requests to the JavaScript files in JS module)
Is it a valid site (enabled and running in CMSSiteManager) and domain name with a correct license and alias ?
Any custom modifications to web.config file that possibly changed httpHandlers or modules ? And are you running the correct extensionless URL settings in web.config ?