Using ISAPI rewrite

312 Views Asked by At

I am using IIS and HELICON ISAPI rewrite. Previoulsy I had one website on IIS but have had to add another. So I have one default website and one virtual directory.

My home directory setup is C:\Inetpub\wwwroot\

within wwwroot I have two sub folders C:\Inetpub\wwwroot\site1 and C:\Inetpub\wwwroot\site2

I have something similar rewrite rules:

RewriteCond %{REQUEST_FILENAME} !(/site1.*) [NC] RewriteCond %{REQUEST_FILENAME} !-s [NC] RewriteRule (/site2/.*) /site2/urlhandler.cfm\?404;http\://%{SERVER_NAME}/$1\?%{QUERY_STRING}

This works ok however I get a file not found for all sub folders in site2. Anyone have any ideas?

1

There are 1 best solutions below

0
On

Please try the following config instead:

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !^/site1.* [NC] 
RewriteRule ^(site2/.*)$ /site2/urlhandler.cfm\?404;http\://%{SERVER_NAME}/$1 [NC,L]