Question

I'm working on a dynamic thumbnail generation feature for a site, and I am using mod_rewrite features to do a quick caching of the images that are already generated.

I do this with the following Rewrite conditions:

RewriteCond  %{DOCUMENT_ROOT}%{REQUEST_FILENAME}    !-s
RewriteRule  ^/thumber/images/([0-9]+)_([0-9]+)_(.+)$  /thumber/thumbnail.cfm?src=$3&w=$1&h=$2  [PT,L,QSA]

The first line makes sure that the rewrite rule only forwards to my script page if the requested image doesn't already exist.

This works fine in Apache 2, but when I move the same rules to an IIS server with ISAPI Rewrite 3 Lite then it always acts as if the file doesn't exist, even after the first redirect when the thumbnail has already been generated.

In short, for some reason the !-s flag appears as if it's not working at all. I have also tried with !-f and there is no change.

I'm thinking that maybe this version of ISAPI Rewrite is using some sort of cached information to determine if the file exists or not.

Other than that I can't understand why it works on Apache but not on ISAPI.

Please help!

Thanks

Était-ce utile?

La solution

Ok, I found the problem!

It all came down to a permissions issue. The ISAPI Rewrite process didn't had enough permissions to read the contents of the folder in which I was writing the generated thumbnails (/thumber/images/), so it assumed that the file didn't exist.

The solution was to assign the correct permissions to the right users.

I just followed the steps in this blog post:

http://vbscriptautomation.net/29/wordpress-permalinks-isapi-rewrite-3-windows-plesk/

Thanks

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top