0

I want to rewrite:

Test.php to Default.asp

So I use the rule:

<rewrite url="~/Test.php" to="~/default.asp" />

But that rule gives a 404.

However this rule works fine:

<rewrite url="~/default.aspx" to="~/default.asp" />

But this rule 404's:

<rewrite url="~/Test" to="~/default.asp" />

My web.config:

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

    <configSections>
        <section name="rewriter"
                 requirePermission="false"
                 type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" />
    </configSections>

    <system.web>

        <httpModules>
            <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" />
        </httpModules>

    </system.web>

    <system.webServer>

        <modules runAllManagedModulesForAllRequests="true">
            <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule" />
        </modules>

        <validation validateIntegratedModeConfiguration="false" />

    </system.webServer>

    <rewriter>
        <rewrite url="~/Test.php" to="~/default.asp" />
    </rewriter>

</configuration>

1 Answer 1

1

What is PHP being handled by?

Per the setup documentation you need to ensure that the PHP extension is being handled by ASP.NET. In addition, if IIS is checking to see if the file exists before handing it off to ASP.NET you'd potentially be missing this as well.

Also, based on your system.webServer addition (which isn't detailed on the module's site), can we assume Server 2008? If so, can I recommend URL Rewrite instead?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.