sábado, 23 de julio de 2011

Using IIS 7.5 with URL Rewrite and Symfony

The IIS URL Rewrite 2.0 is IIS module that promises to do what the mod_rewrite does for Apache.


Download the URL Rewrite module from http://www.iis.net/download/urlrewrite .


Installation


Install the rewrite_2.0_rtw_x32.msi (or rewrite_2.0_rtw_x64.msi if you´re using a 64bit OS).


201107231141.jpg


201107231142.jpg


Check the the fastcgi is properly configured in your php.ini. This is not part of the installation of the URL Rewrite module but I had to do it because I changed from PHP 5.3 to 5.2 (due to the reasons explained at http://tecnofuenteabierta.blogspot.com/2010/12/running-symfony-14-with-ms-sql-server.html ).


cgi.force_redirect=0


fastcgi.impersonate=1


fastcgi.logging=0


extension_dir = "C:\PHP\ext"


extension=php_pdo.dll


Importing the Rules


Next thing you need is to import the rules from the .htaccess file.


Open the Internet Information Services (IIS) Manager on the left pane click on your site (for details on how to configure IIS for Symfony take a look at [2]) and you´ll see an icon URL Rewrite


201107231152.jpg


Double click on the URL Rewrite icon. On the left pane named Actions click on Import Rules…


Select the .htaccess file on your web folder and click Import. Click on Apply.


201107231153.jpg

Click on Back to Rules… and you´ll see the rules imported.


201107231153.jpg

What this does is write a web.config file on your web folder than contains the rules for the URL Rewrite module and other fun thing Microsoft deems important.


Note: If you´re using rsync to update your site with –delete option be sure to copy the web.config file otherwise it will delete every time you update with rsync.


rsync -avr --delete --exclude-from=‘ path/exclude.txt‘ source/dir target/dir


201107231154.jpg


CREATOR OWNER SPECIAL


SYSTEM FULL CONTROL


ADMGISSVR SPECIAL


Administrators Full Control


Users Read & execute, List folder contents, Read


References


[1] http://www.iis.net/download/urlrewrite


[2] http://www.symfony-project.org/more-with-symfony/1_4/en/11-Windows-and-Symfony



No hay comentarios:

Publicar un comentario