Skip to content

Instantly share code, notes, and snippets.

@fabiancarlos
Created July 19, 2012 20:01
Show Gist options
  • Save fabiancarlos/3146404 to your computer and use it in GitHub Desktop.
Save fabiancarlos/3146404 to your computer and use it in GitHub Desktop.
Kohana 3.2 URL Rewrite of the IIS 7/Windows 2008 **using conversor of .htaccess to web.config
<!--# link: http://learn.iis.net/page.aspx/470/importing-apache-modrewrite-rules/ -->
<configuration>
<system.webServer>
<rewrite>
<rules>
<!--# Turn on URL rewriting-->
<!--# Protect hidden files from being viewed-->
<!--# Protect application and system files from being viewed-->
<rule name="Imported Rule 9" stopProcessing="true">
<match url="^(?:application|modules|system)\b.*" ignoreCase="false" />
<action type="Rewrite" url="index.php/{R:0}" />
</rule>
<!--# Rewrite all other URLs to index.php/URL-->
<rule name="Imported Rule 10">
<match url=".*" ignoreCase="false" />
<conditions>
<!--# Allow any files or directories that exist to be displayed directly-->
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
@JayGreentree
Copy link

This works perfectly for me on Godaddy hosting. Thanks other sites I've tried led me back to the dreaded 500 errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment