Jun 4, 2009 at 12:23 PM
Edited Jun 4, 2009 at 2:07 PM
I am new to URL rewriting so please forgive me if I have got a few things wrong here.
I am trying to use the rewrite filter with IIS and CakePHP. I've almost got it working correctly. The problem is CakePHP uses colons in it's address for certain functions and the filter isn't processing any URLs with a colon in it.
How do I get IIRF to process a URL with a colon?
Below is all the information relating to my current setup and problem. I'm writing this message from work so may have a couple of things wrong with formatiing of the ini file.
I am using a virtual directory for my cake application, (I'll call it cakeapp) under the website www.myweb.com. I've successfully installed the DLL filter and have it working. When I enter a cake address of http://www.myweb.com/cakeapp/
the website is displayed correctly. This is the main URL to the application so doesn't get rewritten. In order for my application to work I have to rewrite everything after http://www.myweb.com/cakeapp/ and put it add the end of http://www.myweb.com/cakeapp/index.php?url=
. Compared to the others I have seen, this is a simple rewrite. To achieve this my IIRF.ini file, which is the only one on the site/server and is in the cakeapp directory (I think), contains the following rules:
- RewriteRule ^/cakeapp/index.php(.*)$ - [L] #this will allow normal list to not be processed
- RewriteRule ^/cakeapp/css/(.*)$ - [L] #I had to put this one in to ensure the CSS files were loaded correctly
- RewriteRule ^/cakeapp/img/(.*)$ - [L] #I had to put this one in to ensure the Imagesfiles were loaded correctly
- RewriteRule ^/cakeapp/(.*)$ /cakeapp/index.php?url=/$1 [L] #this is the one which does the work. Rewrites everything else to http://www.myweb.com/cakeapp/index.php?url=
When I enter an address of http://www.myweb.com/cakeapp/records/page this is correctly rewritten to http://www.myweb.com/cakeapp/index.php?url=/records/page and displays the page correctly and the log
file indicates it is being filtered. However, when I enter the address (or click on a link) to display page 2 of the records (http://www.myweb.com/cakeapp/records/page:2 ) the page fails to load with a 404 error. When I enter the address http://www.myweb.com/cakeapp/index.php?url=/records/page:2
manually it displayys the page correctly. Nothing is recorded in the IIRF log when I get the 404 error but the log records the address when I use the index.php? way of requesting the page. Other features like sorting tables etc which also
use colons in the address also display the same 404 error.
Does anyone have any suggestions how I can get around this problem or how to configure IIRF correctly to give me more information to find out why the address isn't working?