By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,948 Members | 1,595 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,948 IT Pros & Developers. It's quick & easy.

getting a default error page even though customErrors mode="Off"

denny1824
P: 32
I have a working website. I copied all the files to a new folder in inetpub/wwwroot and then set that folder as a Virtual Directory in IIS. I try going to that site from the new folder and i am getting a default error page. It is an aspx page that I am trying to view.

If I put in a fake page name it gives a different error about that fake name not existing, which means to me that it is seeing the page I want to view but is giving an error and displaying the default error page:

Expand|Select|Wrap|Line Numbers
  1. Runtime Error 
  2. Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. 
  3.  
  4. Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
  5.  
  6.  
  7. <!-- Web.Config Configuration File -->
  8.  
  9. <configuration>
  10.     <system.web>
  11.         <customErrors mode="Off"/>
  12.     </system.web>
  13. </configuration>
  14.  
  15.  
  16. Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
  17.  
  18.  
  19. <!-- Web.Config Configuration File -->
  20.  
  21. <configuration>
  22.     <system.web>
  23.         <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
  24.     </system.web>
  25. </configuration>
  26.  
I do have a web.config file on the root directory of the virtual folder with the customErrors mode = "Off". The website still works under the orignal folder.

How can I get the website to work under a different folder name?
Apr 13 '09 #1
Share this Question
Share on Google+
15 Replies


Frinavale
Expert Mod 5K+
P: 9,731
Is your IIS set up to redirect the user to the default error page if an error occurs?
Apr 13 '09 #2

Plater
Expert 5K+
P: 7,872
Do virtual directories allow ASPX pages to run?
Apr 13 '09 #3

denny1824
P: 32
to Frinavale: IIS does redirect to default page for certain HTTP errors: 403;14 is "Forbidden - Directory Listing Denied", 500 is "Internal Server Error", 501 is "Not Implemented", 502 is "Bad Gateway". I don't think I am getting any of those errors in this case. Do you know how I can be sure?

to Plater: Yes, as far as I know, aspx pages can be run in virtual directories. I have the orignal website working just fine in a virtual directory on the same machine. The only difference here is that I copied the files into a different virtual directory.

I need to have 2 copies so that I can make changes to one and still have the original available to be viewed. So right now I am just trying to get 2 copies of the same website working on the same machine. Maybe there is a better way to do it than put the second one in a different virtual directory?
Apr 14 '09 #4

Frinavale
Expert Mod 5K+
P: 9,731
What version of IIS are you using?
Please check the Windows Event Logs for an indication of the problem as well.
Apr 14 '09 #5

denny1824
P: 32
IIS is version 5.1
OS is Windows XP
I dont see anything in the event viewer that indicates the problem.
Apr 14 '09 #6

Frinavale
Expert Mod 5K+
P: 9,731
Let's create another web site for your app.
  • Open IIS.
  • Right click on the Default Web Site.
  • Select New -> Virtual Directory
  • Click Next in the Virtual Directory Creation Wizard
  • Provide "TestWebsite" as the Alias on the Virtual Directory Alias step and click Next.
  • Click the Browse button on the Website Content Directory step.
  • Browse to the C:\Inetpub\wwwroot\ directory.
  • Click the Make New Folder button and name the new folder "TestWebsite"
  • Highlight the "TestWebsite" folder and click Ok.
  • Click the "Next" button in the Web Site Content Directory step of the wizard.
  • Make sure that Read and Run Scripts (such as ASP) are checked on the Access Permissions step and click the Next button.
  • Click the Finish button.

Now we have a new website set up to point to a virtual directory located on the IIS.

Open your web application in Visual Studio. In the Solution Explorer right click on your web application's name and select Publish. When prompted for the Target location click the "..." button. This will open the Open Web Site dialogue. Select "Local IIS" in the left pane of this dialogue and select "TestWebsite" in the right pane then click the Open button. Click the Publish button in the Publish Web dialogue.

Then try connecting to the TestWebsite (be sure to provide an aspx page to connect to in the url since we haven't set up a Default Web Page for the "TestWebsite" website in IIS).

-Frinny
Apr 14 '09 #7

denny1824
P: 32
I dont have Visual Studio on the server. I tried making TestWebsite on the development computer.

When I try to publish TestWebsite I get the error: "You must choose a publish location that is not a sub-folder of the source Web site."
Apr 14 '09 #8

Frinavale
Expert Mod 5K+
P: 9,731
Publish the website to a folder on your desktop.
Then upload the files in that folder to the server (into the C:\Inetpub\wwwroot\TestWebsite directory)
Apr 14 '09 #9

denny1824
P: 32
After uploading the files to the inetpub/wwwroot folder Ii went into IIS and set it as an application in IIS.

It is giving the same type of default error page.
Apr 14 '09 #10

Frinavale
Expert Mod 5K+
P: 9,731
Did it give you an error before you set it up as an application?
Are you sure there is no errors/warnings being recorded in the Server's Window Event logs?
Apr 14 '09 #11

denny1824
P: 32
The error it gives before I set it up as an application is the same as after except that instead of the top line being "Server Error in '/TestWebsite' Application." it says "Server Error in '/' Application."

To check the Server's Window Event logs I went to Control Panel -> Administrative Tools -> Event Viewer. I see a bunch of warnings and errors about a missing printer driver, but nothing that seems to me to be about websites. Nothing shows up under Internet Explorer in the Event Viewer.
Apr 16 '09 #12

Frinavale
Expert Mod 5K+
P: 9,731
Is the Default Website configured to use ASP.NET?
Is the testWebsite configured to use ASP.NET?
Is the ASP.NET version correct (please note that 2.0 works for 3.0 and 3.5 since they are addons....so long as these are installed on the server)
Apr 16 '09 #13

denny1824
P: 32
I went back and grabbed an older copy of the website and put it on. That seems to be working. I haven't figure out what I am doing wrong with the newer version but this should work for now.

Thank You for your time and patience
Apr 16 '09 #14

Frinavale
Expert Mod 5K+
P: 9,731
Are you using newer DLLs in the newest version of your website?
Are they installed on the server?
Apr 16 '09 #15

denny1824
P: 32
Nope, no new dlls. No new pages. Only changes to existing pages and updating the web.config with connection strings to a different database. The database connection is working for the original changes, just not for when I copy it to a different folder.
Apr 18 '09 #16

Post your reply

Sign in to post your reply or Sign up for a free account.