Sitellite can be made to run on IIS, however it is not a simple thing to do (this goes doubly if you are also using SQL Server). It is recommended that you be comfortable with both IIS and Sitellite.
Below is not a step by step guide to installing on IIS, but a list of considerations to help you along.
1) URL Rewriting - you need to recreate Apache's mod_rewrite on IIS in order to redirect URLs to the right place. I recommend downloading and installing ISAPIRewrite from http://www.isapirewrite.com/
In the httpd.ini file, add the appropriate rewrite rules. For example:
# this handles the /sitellite shortcut, could do with improving
RewriteRule /sitellite(/){0,1} /index.php?sitelliterequest=/index/cms-app/ [I,L]
# this handles all other requests
RewriteCond URL (?!.*\.(?<!\mode\.)(?:css|js|jpg|bmp|swf|ico|gif|zip|png|html|htm|php))(?:.*)
RewriteRule ([^\?]*)(?:\?(.*))? /index.php\?$2&sitelliterequest=$1 [I,L]
Note that there are some differences between ISAPIRewrite and mod_rewrite rules. Consult the ISAPIRewrite documentation for more information.
2) IIS does not support $_SERVER[REQUEST_URI], so the above rules send the request to index.php (renamed from index for simplicity) as a $_GET variable.
Add the following to the begining of index.php to catch it:
<?php
$_SERVER['REQUEST_URI'] = $_GET['sitelliterequest'];
unset($_GET['sitelliterequest']);
?>
Sitellite is now none the wiser and should recve requests as normal.
For more information on the difference in the $_SERVER arrays for Apache and IIS, see this link:
http://koivi.com/apache-iis-php-server-array.php
3) When redirecting with the header function, IIS requires an absolute URL.
In many places Sitellite uses code such as:
<?php
header ('Location: ' . $prefix . 'index/cms-app');
?>
Since it is given a relative location, IIS will have an issue. Instead, replace all Location headers with something like
<?php
header ('Location: ' . $GLOBALS['site']->url . '/' . $prefix . 'index/cms-app');
?>
There may be other issues I've missed here, feel free to add them if you find any.
Running Sitellite on IIS is a messy job, and since it requires changes throughout the system could make future upgrading difficult.
Click here to view another IIS configuration from the forum.
Revision from August 1, 2007 1:15 PM by admin
Back in time (3 more) | Linked from: Trouble Shooting