Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 28058

Using SQL Server Rewrite Provider & Getting Internal Server Error every time

$
0
0

After setting up Rewrite Provider from the link below, and the Rule to do the redirect, I am getting an Internal Server Error 500 every time no matter what I use as a URL.

http://www.iis.net/learn/extensions/url-rewrite-module/using-custom-rewrite-providers-with-url-rewrite-module

Specifics:

I added the provider with name DB and ran a SQL Profiler and noticed there was a lot of SQL going on against the RewriteDb, which seems to mean the data has been cached properly.

I have a "Default Web Site" with an application underneath named "9.2", using DefaultAppPool Application Pool and ApplicationPooldentity.

If I disable the rules, and run http://localhost/test/pm/default.asp it works fine.

If I run http://localhost/test/default.asp  it doesnt exist and correctly doesnt work getting a 404 error.

If I add a rewrite rule to rewrite from /test to /test/pm it works

I get a Internal Server Error 500 every time I try the rule using the SQL Server DbProvider

Any help would be greatly appreciated

Regards

Rob

Below is my entire web.config (with my server name replaced with MyServer) in case that helps. you will noticed that one is disabled and one is enabled, I have been trying different things including both list there:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
    <rewrite>
        <providers>
            <provider name="DB" type="DbProvider, Microsoft.Web.Iis.Rewrite.Providers, Version=7.1.761.0, Culture=neutral, PublicKeyToken=0545b0627da60a5f">
                <settings>
                    <add key="ConnectionString" value="Data Source=MyServer;Initial Catalog=RewriteDB;Integrated Security=True" />
                    <add key="StoredProcedure" value="GetRewrittenUrl" />
                        <add key="CacheMinutesInterval" value="1" />
                </settings>
            </provider>
        </providers>
        <rules>
            <rule name="DbProviderTest" enabled="false" stopProcessing="true">
                <match url="(.*)" />
                <conditions trackAllCaptures="true">
                    <add input="{DB:{R:1}}" pattern="(.+)" />
                </conditions>
                <action type="Redirect" url="{C:1}" />
            </rule>
            
            <rule name="Rewrite ASP" enabled="true" stopProcessing="true">
                <match url="(.*)" />
                <conditions trackAllCaptures="true">
                        <add input="{DB:{R:1}}" pattern="(.+)" />
                </conditions>
                <action type="Rewrite" url="{R:1}" logRewrittenUrl="true" />
            </rule>            
        </rules>
    </rewrite>
</system.webServer>
</configuration>

Rewrite Providers SQL Server getting Internal Server Error 500 every time


Viewing all articles
Browse latest Browse all 28058

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>