Prosper 202 on Windows IIS

I’ve been running more PHP and Mysql apps on windows IIS servers lately… I hope this is not the result of some disorder ;p

Wanted to try out Prosper202 Click tracking software. Downloaded the latest, version 1.9.29 as of writing.

First issue encountered – the app highly recommends installing memcache for performance. I did some checking and memcache on windows looks like it hasn’t been done in a while… the couple binaries I found that might work are pretty outdated or were just broken links. Decided to skip this for now and revisit later (maybe).

Second issue was a bit trickier- the app loaded and installed the database, but one I logged in, some things were obviosuly not working correctly. I noticed that many of the ajax widgets on the page just kept showing spinners, never loading. I looked at the source on the page and all the realtive links in the page were prepended with “\” instead of “/” – an obvious goof related to how the windows os uses backslashes instead of forward slashes like linux os’es use.

I traced this down to a function, in the \202config\functions.php file- Update your get_absolute_url() function with this code:

function get_absolute_url() {

$tmp = substr(substr(dirname( __FILE__ ), 0,-10),strlen(realpath($_SERVER[‘DOCUMENT_ROOT’])));

$tmp = str_replace(‘\\’, ‘/’, $tmp);

return $tmp;

}

The first line is pretty much what the original used, but then we add a replace for any backslashes to make them into a fwd slash. I haven’t checked further if maybe we could slice off the first char every time and replace it instead, but this broad replace function seems to work so far.

The software seems to work now, but will proceed next to actually try it – and see if any other problems or performance issues arise.

IIS7 URL Rewrite – Remove www from all urls

I’ve always used the canonical rule template on IIS rewrite to force a www prefix on my urls. Recently I’ve started setting up sites that do the opposite – force no www in the front. Easy enough to do if you have nost headers configured, just select which host name to force to and bam, done.

Now I have a project that is a single web app mapped to an IP. Im running orchard 1.3x on it, so the multi-tenant module allows quick configuraiton of a new site. With the dedicated IP, I don’t have to mess with adding host headers every time I need to create a new site- just set it in DNS and away we go.

The problem with this scenario is – I still had to go into IIS and configure canonical url rules for each new site. What would be nice is to just set one rule that says “strip the www off ANY url coming to this site”.

 

I found the basics for this rule elsewhere on the web, and tuned it to do exactly that:

 

<rule name=”Remove www” stopProcessing=”true”>
  <match url=”(.*)” ignoreCase=”true” />
  <conditions logicalGrouping=”MatchAll”>
    <add input=”{HTTP_HOST}” pattern=”^www\.(.+)$” />
  </conditions>
  <action type=”Redirect” url=”http://{C:1}/{R:0}” appendQueryString=”true” redirectType=”Permanent” />
</rule>

 

Add this in your rules section of the web.config file and you’ll be good to go.