I'm installing ToroPHP (PHP routing class) on my server. However, it happens to be my first windows server, I'm trying to learn it.
Here is the required ModRewrite code as if it was an Apache server for Toro:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php)
RewriteRule ^(.*)$ /index.php/$1 [L]
I have read through these two articles/questions, but for the life of me I can't figure out why it isn't working. I'm hoping somebody can walk through each part of the "windows IIS ported version" of this...
Here's what I'm trying, but it doesn't seem to work:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="toro" stopProcessing="true">
<match url="^(.*)$ /index.php/$1" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" pattern="{UrlEncode:{R:1}} !^(index\.php)" />
</conditions>
<action type="Rewrite" url="^(.*)$ /index.php/{UrlEncode:{R:1}}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Thanks.
URL ReWrite for Windows Server (IIS) and http://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/translate-htaccess-content-to-iis-webconfig
I use Toro as well and this work for me, but not the root "/". Found this on IIS.net: http://www.iis.net/learn/extensions/url-rewrite-module/enabling-pretty-permalinks-in-wordpress
To make the root work, you will need to make a modification into the Toro.php file, on line 11, replace the line:
by
For some reason IIS return the
$_SERVER['ORIG_PATH_INFO']
as equal as/index.php
instead of/
.