Saturday, July 6, 2013

URL rewrite for 2 apps on IIS7

I have a question about how to configure url rewriting in Windows IIS7.

Assume my project root folder is MyProject, and beneath there are 2 applications.  One is in MyProject\app folder, and the other is in MyProject\app2 folder.  I am using CakePHP 1.3, and MyProject\cake is the cake folder.
For first application in MyProject\app, I add an web site in IIS pointing to MyProject, the root folder.  And the file MyProject\web.config contains the content as specified by the Cake 1.3 book (http://book.cakephp.org/1.3/en/The-Manual/Developing-with-CakePHP/Installation.html#url-rewrites-on-iis7-windows-hosts).  And it works just fine.
My question is how to configure for my 2nd application MyProject\app2?  What I did is create another web site in IIS pointing to MyProject\app2 (I guess it can't be MyProject folder as it's the same as my first application.)  Then inside MyProject\app2 I create another web.config with the same content as the previous web.config except that the write url is changed to MyProject\app2\webroot.  But this configuration does not work.  When I visit app2, it will just show me the IIS7 default home page.

Please note that this is for my development on Windows 7.  The same folder structure works well on my CentOS production environment using nginx.

Could I use two apps with the same cake folder on Windows IIS7?  What else could I do?  If I need to change the folder structure, what else do I need to change for it run as previously on my CentOS production server?

Thanks!
Zhu Ming

--
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: