I am having troubles to configure IIS 7 to work as I expect. I have been looking for solutions for some months but I don't get it working...
At my wwwroot folder i have 4 subfolders (each one for a different web app).
I am using CakePHP framework for one of those sites and the only way I found to make it work with IIS7 is pointing directly the Default Web Site to inetpub\wwwroot\cakephp\app\webroot\ in the Local path field of the Home Directory tab. (as is detailed here)
That works perfectly, but the problem is that I can not add any other CakePHP made website to my "Default Web Site", as to access my previous configured website I have to use the base Url and not a subfolder: (http://myhost/)
I have tried to point the Local path of the the subfolder to that same directory and pointing the Default Web Site to inetpub\wwwroot\ but it doesn't work properly. With this, I would be able to host and access to different websites (http://myhost/cakephp/, http://myhost/app2/, http://myhost/app3/ ... )
When I try to access my site after doing so (http://myhost/cakephp/) it shows the index page, but when I try to exeute any action (http://myhost/cakephp/action/) it shows a 404 error. However, any other site not made with CakePHP works perfectly ( that's why i guess this might be related with CakePHP routing)
Why is it if I am applying the exact same Local Path as I was applying before the the whole Default Web Site? Is there any way to solve it?
Can it be because I am making use of a web.config file inside my app?
CakePHP frameworks needs of a web.config file to work (or .htaccess in case of using Apache), which is inside inetput\wwwroot\cakephp\ :
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="Imported Rule 0" stopProcessing="true"> <match url="^(img|css|files|js)(.*)$"></match> <action type="Rewrite" url="app/webroot/{R:1}{R:2}" appendQueryString="false"></action> </rule> <rule name="Imported Rule 1" stopProcessing="true"> <match url="^(.*)$" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> </conditions> <action type="Rewrite" url="index.php?url={R:1}" appendQueryString="true" /> </rule> <rule name="Imported Rule 2" stopProcessing="true"> <match url="^$" ignoreCase="false" /> <action type="Rewrite" url="/" /> </rule> <rule name="Imported Rule 3" stopProcessing="true"> <match url="(.*)" ignoreCase="false" /> <action type="Rewrite" url="/{R:1}" /> </rule> <rule name="Imported Rule 4" stopProcessing="true"> <match url="^(.*)$" ignoreCase="false" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> </conditions> <action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" /> </rule> </rules> </rewrite> </system.webServer> </configuration>
I don't really know how it works internally but what I dont understand is why if I am pointing to the exact same Local Path as before, but now in a subfolder, it doesn't work.
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:
Post a Comment