Welcome Guest, Not a member yet? Register   Sign In
IIS 7.0, FastCGI and the new IIS 7 URL Rewriting
#2

[eluser]hooflung64[/eluser]
Ok I have CI and URL Rewrite Module for IIS 7.0, Go Live working now with help from ruslany of the IIS.net forums.

This code can go into the web.conf file that each website in IIS 7 will have. I am using Windows 2k8 x64. The web server role was added after the update to the system. FastCGI was added and PHP 64bit from fusionxlan was used. Then the URL Rewrite for IIS 7.0, Go Live installed which adds the hotfix for the Request_URI server variable for PHP.

Code:
<rule name="MyRule">
      <match url="^(.*)$" />
       <conditions>
             <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
             <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
             <add input="{HTTP_HOST}" pattern="(?:www\.)?myurl\.org" />
        </conditions>
        <action type="Rewrite" url="index.php/{R:1}" appendQueryString="false" />
</rule>

For development machines you can omit the third "add" tag and you can access your site via the IP and, if necessary, the port number. I found it unnecessary to use the "?" after index.php as I have to in IIS 6.

Code:
$config['base_url'] = "http://x.x.x.x:81/";


This is what I use for the site I am developing now. Obviously I use numbers ;-)

Code:
$config['uri_protocol'] = "PATH_INFO";

AUTO works too now although it ueses PATH_INFO. The others do not work with IIS 7 on my setup. QUERY_STRING was what I had to use with IIS 6.

You no longer need the extra rewrite rules for images and javascript because the matchType="isFile" negate="true" and matchType="isDirectory" negate="true" takes care of that.

Here are some screenshots of the process to do it via the GUI:

Step 1
Step 2
Step 3

So far I haven't had any URL rewriting issues now that I actually configured CI correctly (I had a brainfart and didn't remove the index.php from the $config['index_page'] setting in the config.php file.)

I hope this helps. I am a huge Linux fan. I have payed for Transgaming for 5 years and have a serious crush on Debian and Ubuntu. However, IIS 7 and Windows 2k8 in general has been winning me over for my 9-5 and now CI and IIS to me are a winning combination instead of the red headed stepchild. I don't feel like a warlock at work doing black magic that IIS 6 had me doing for Ruby on Rails and CI to work properly.


Messages In This Thread
IIS 7.0, FastCGI and the new IIS 7 URL Rewriting - by El Forum - 09-24-2008, 01:40 PM
IIS 7.0, FastCGI and the new IIS 7 URL Rewriting - by El Forum - 10-08-2008, 02:33 PM
IIS 7.0, FastCGI and the new IIS 7 URL Rewriting - by El Forum - 03-05-2009, 08:35 AM
IIS 7.0, FastCGI and the new IIS 7 URL Rewriting - by El Forum - 07-27-2010, 01:45 AM
IIS 7.0, FastCGI and the new IIS 7 URL Rewriting - by El Forum - 07-27-2010, 04:46 AM
IIS 7.0, FastCGI and the new IIS 7 URL Rewriting - by El Forum - 10-22-2010, 06:28 PM
IIS 7.0, FastCGI and the new IIS 7 URL Rewriting - by El Forum - 03-18-2011, 04:18 PM
IIS 7.0, FastCGI and the new IIS 7 URL Rewriting - by El Forum - 03-22-2012, 07:01 AM
IIS 7.0, FastCGI and the new IIS 7 URL Rewriting - by El Forum - 04-27-2012, 07:32 AM
IIS 7.0, FastCGI and the new IIS 7 URL Rewriting - by El Forum - 01-28-2013, 09:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB