2

I want to create a very simple URL rewrite rule. I'm using IIS 7 Express (XP) locally with Visual Studio 2010. The rule I've created (copied from an example here) works perfectly locally. However as soon as I copy it to my Hosting server, I get a 500 error.

Excerpt from web.Config:

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <rewrite>
        <rules>
            <rule name="Rewrite to article.aspx">
                <match url="^article/([0-9]+)/([_0-9a-z-]+)" />
                <action type="Rewrite" url="article.aspx?id={R:1}&amp;title={R:2}" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>

Assuming that the rule is what is breaking the application I've removed the rules section but the application still throws a 500 error. However if I remove the rewrite section entirely the application loads properly.

So my question is, am I missing anything from my web.Config? Their claim is that it's a scripting issue and that the URL Module is properly installed and working on their IIS 7 server. Is there any way I can confirm this with a script?

Adam
  • 16,089
  • 6
  • 66
  • 109

1 Answers1

0

I had exactly the same issues, and spent WAY too much time trying to work with GoDaddy support to get Microsoft URL Rewrite working. Eventually, I got ManagedFusion Rewriter up and running based on this post.

I am on GoDaddy 4GH Ultimate Windows host, with SSL enabled. I have WordPress installed in the root (permalinks are working now!), and other .NET applications running in virtual directories.

I truly hope this helps someone avoid trying to get Microsoft URL Rewrite working on GoDaddy Grid Hosting...

For the record, here are my rewrite rules for ManagedFusion, to properly handle WordPress permalinks:

RewriteEngine On

RewriteBase /

# wordpress admin folder rewrite rules
RewriteCond %{REQUEST_URI} ^wp-admin/
RewriteRule ^wp-admin/(.*) . /wp-admin/$1 [C]

# wordpress includes folder rewrite rules
RewriteCond %{REQUEST_URI} ^wp-includes/
RewriteRule ^wp-includes/(.*) . /wp-includes/$1 [C]

# wordpress general rewrite rules
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) /index.php [L]

I used the web.config from the linked post verbatim, except that I removed the <defaultDocument enabled="false" /> line.

Community
  • 1
  • 1
Noah Heldman
  • 6,724
  • 3
  • 40
  • 40