在 win2008 r2 iis7.5 中 access 数据库伪静态设置,会出现以下问题:
一、未在本地计算机上注册“Microsoft.Jet.OLEDB.4.0”提供程序。
解决方案:IIS - 应用程序池 - 右键对应的网站应用池 - 高级设置 - 启用32位应用程序 = true。
如下图:
二、当设置应用程序池中启用32位应用程序后,如果出现由于 Web 服务器上的“ISAPI 和 CGI 限制”列表设置,无法提供您请求的页面。
解决方案:IIS - 计算机名称 - ISAPI 和 CGI 限制 - 添加或设置 ISAPI 或 CGI 限制为 允许。
注意,因为应用程序池中启用32位应用程序, ISAPI 或 CGI 路径地址应为:C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll
而不是 C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll
如下图:
三、HTTP 错误 500.22 - Internal Server Error
检测到在集成的托管管道模式下不适用的 ASP.NET 设置。
解决方案:IIS - 应用程序池 - 找到右侧对应的网站应用池 - 双击打开编辑应用池对话框 - 将托管管道模式选择为经典即可。
如下图:
下面是 web.config 内容:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
</configSections>
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>~/([\w]+)\.htm</LookFor>
<SendTo>~/tools/Default.aspx?path=$1</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~([a-z]+)(\/[a-z]+)?(\/\w+)?.htm</LookFor>
<SendTo>~/$1$2/Default.aspx?tplname=$3</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<connectionStrings>
<add name="sqlConnectionString" connectionString="Data Source=(local);Initial Catalog=KingInfoSqlDb;Integrated Security=SSPI;" providerName="System.Data.SqlClient" />
<add name="accConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\App_Data\dat.mdb;Persist Security Info=True;Jet OLEDB:Database Password=" providerName="System.Data.OleDb" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime requestValidationMode="2.0" targetFramework="4.5" />
<httpHandlers>
<add verb="*" path="*.htm" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
</httpHandlers>
<httpModules>
<add type="URLRewriter.ModuleRewriter,URLRewriter" name="ModuleRewriter" />
</httpModules>
</system.web>
<system.webServer>
<handlers>
<add name="RewriteFactory-ISAPI-4_0_64bit" path="*.htm" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv4.0,bitness64" />
</handlers>
<modules>
<add name="URLRewriter" type="URLRewriter.ModuleRewriter" preCondition="managedHandler" />
</modules>
</system.webServer>
</configuration>
演示地址:http://www.369ok.cn/