03 October 2006
Setup a CS site, home works, but links give 404?

This Duncan Nugget is in reference to 404 errors you may get after successfully installing Community Server on a new server.  New, as you haven't had any other ASP.NET websites that use Url Rewriting installed that would show the issue with Url Rewriting INOP.

Issue
After installing Community Server on a new server you go to the homepage.  CS comes up just fine, and you login as the Administrator.  You click Blogs, Forums, Photos, etc and each application's homepage comes up normally.

But when you start clicking on links such as the sample items (a sample forum post, a sample forum, the same blog post, the sample photo upload, etc) you get a general IIS 404 - File Not Found error message.

Resolution
IIS is configured to check that the file physically exist on the HDD before parsing it through the assigned Application Extension.  In this case, the ASP.NET Web Application.  When this happens, IIS fails to parse the requested Url properly and never passes it to the ASP.NET Web Application.  IIS also throws an exception because the file was not found, and matches it to the appropriate error code/page - finally presenting the 404 - File Not Found.

To resolve, open Internet Information Services Manager.

  • Right-click on the website or virtual directory that is running your web application and goto Properties.
  • Click on the Home Directory tab.
  • Under Application Settings, click the Configuration button.
  • In this new Application Configuration window, on the Mappings tab, scroll down and find the .aspx Extension. 
  • Click the .aspx extension once, and then click Edit.  This opens the Add/Edit Application Extension Mapping dialog.
  • Uncheck Verify that file exists and click OK, OK, Apply, OK to exit.

This should take effect immediately, but you may want to restart the Application Pool just in case.

 

More Information
Url Rewriting is becoming very common with ASP.NET programmers to cleanup the URLs the browser and users link to.  Also search engines likes these hard links better then complicated querystrings.  Community Server almost exclusively uses Url Rewriting for all of links.

Url Rewriting takes the requested URL and parses it through a Regular Expression pattern in CS (see SiteUrls.config) to match a specific pattern, and then requests the physical file with a new format behind the scenes.

For the most part, this IIS setting above is disabled by default.  But oddly enough, occasionally we've seen some servers that have had it checked.  Following the resolution above should resolve it from happening in the future by not checking if the file exists.

Thanks to Kevin Cunningham for the tip.

 

Reader's Comments

news of the day a grab bag for what's happening in Community Server A follow-up to the (HA-HA!) funny

# 03 October 06 4:45 PM
paulo said:

is very good

# 16 October 06 3:38 PM

Eric Duncan with a new Duncan Nugget on certain IIS configurations that cause link pages to produce a

# 22 November 06 11:09 AM

Eric Duncan with a new Duncan Nugget on certain IIS configurations that cause link pages to produce a

# 12 March 07 9:01 AM
Leave a Comment
Comment Policy: HTML is not allowed. Links and line breaks are converted automatically.
(required) 
(optional)
(required) 

 


  
Enter the anti-spam code you see above (required)

 

Comment Notifications
Subscribe to this post's comments using RSS

If you would like to receive an email when updates are made to this post, please register here