0

I'm trying to get IIRF working so that it rewrites certain URLs, but ignores files like .css and .js files.

I have URLs like:

/admin/
/admin/user/
/admin/user/view-details/1
/admin/user/view-details/1?edit

Which all work, but I can't seem to get this to work:

/admin/_assets/css/admin.css

My .ini file looks like this:

RewriteRule /admin/([^/]+)/([^/]+)/([^/]+)\?edit$ /admin/index.php?edit&action=$1&sub-action=$2&id=$3 [L,I,QSA]
RewriteRule /admin/([^/]+)/([^/]+)/([^/]+)$ /admin/index.php?edit&action=$1&sub-action=$2&id=$3 [L,I,QSA]
RewriteRule /admin/([^/]+)/$ /admin/index.php?action=$1 [L,I,QSA]
RewriteRule ^/admin/(.*)$ - [L]

I've also tried:

RewriteRule (.+\.)(php|jpg|png|jpeg|gif|ttf|sql|txt|htm|zip|css)$ - [L]

The things I've tried give either a blank document when I navigate directly to the css file, or I get:

HTTP Error 404.4 - Not Found
The resource you are looking for does not have a handler associated with it.

I don't have much experience with IIRF or IIS, so I'm a bit stuck with what to try next. Am I looking in the wrong place? Or have I made a really basic mistake?

Thanks

gmadd
  • 1,146
  • 9
  • 18
  • Did you place `RewriteRule (.+\.)(php|jpg|png|jpeg|gif|ttf|sql|txt|htm|zip|css)$ - [L]` before the other rules? Did you try to set `RewriteLogLevel` and look at the log file to see what's going on? – marapet Aug 10 '11 at 23:14
  • Yes, it's before the other rules, but I'm not getting anything logged in the log file with RewriteLogLevel 3, maybe that's a problem in it's own right. – gmadd Aug 10 '11 at 23:29
  • It's currently: RewriteLogLevel 3 RewriteLog C:\inetpub\IonicIsapiRw\log.txt - I should add, this was all set up before I got involved, it doesn't look like anything has ever been logged. – gmadd Aug 10 '11 at 23:35

2 Answers2

1

Tip for debugging iirf: use StatusUrl to check first for problems.

marapet
  • 54,856
  • 12
  • 170
  • 184
0

I've managed to fix this by adding:

RewriteRule /admin/_assets/(.+)$ /admin/_assets/$1 [L,I,QSA]

to the top of my file. I'm still not sure why nothing is being logged, but this fixed it for my needs.

gmadd
  • 1,146
  • 9
  • 18