ASPX Master Page Dropped using RewriteRule

Topics: User Forum
Nov 28, 2009 at 9:22 PM

I just started experimenting with IIRF and have run into something a little odd. I don't think this is necessarily an "IIRF" issue but I wasn't sure where else to post the question.

I have two test rewrite rules in my iirf.ini file as follows:

RewriteRule ^/abt   /AboutUs.aspx
RewriteRule ^/HomesForRent/([^/]+)/([^/]+)/([^/]+) /SearchPropertyListing.aspx?propertyId=$3

In the first case, the rewrite works fine, the user is presented with the About Us page properly formatted with the correct master page and related css files.

In the second case, the SearchPropertyListing.aspx page drops any master page reference and the user is presented with the correct dynamic content albeit in a lousy looking screen. The HomesForRent folder does not exist.

I get the same issue if I change the first rewrite rule to "RewriteRule ^/foo/abt   /AboutUs.aspx".

Thanks for any assistance.



Nov 29, 2009 at 3:19 PM

If you look in the IIRF log you should be able to figure out why.

Something is being rewritten that should not be.  Or something is not being rewritten that should be. 

Nov 29, 2009 at 8:52 PM

Thanks for the pointers. I was able to resolve using the log files.  Thanks for the quick response and the wonderful tool.

Dec 5, 2009 at 1:36 PM

sure thing, glad you like it.


Dec 6, 2009 at 8:28 PM

Hi i got the same problem. could u both post the solution u found?

Im at a public hosting and writing a log is not easy because of permissions.



Dec 7, 2009 at 1:29 PM


The key for me, as cheeso suggested, was turning on the logging.  You can then see how the regex expressions are fowling up your paths to supporting resource files.

Here is a snippet of my iirf.ini file:

# uncomment these while testing, turn them off during production to reduce load

#RewriteLogLevel 4
#RewriteLogFile c:\temp\iirf12
#RewriteEngine ON
#StatusUrl /iirfStatus
#IterationLimit 5

RewriteRule ^/(?i)HomesForRent/([^/]+)/([^/]+)/([^/]+).(css|js) /$3.$4 [L]
RewriteRule ^/(?i)HomesForRent/([^/]+)/([^/]+)/images/([^/]+).(png|jpg|gif|jpeg) /images/$3.$4 [L]
RewriteRule ^/(?i)HomesForRent/([^/]+)/([^/]+)/thumbnailTemp/([^/]+).(png|jpg|gif|jpeg|PNG|JPG|GIF|JPEG) /thumbnailTemp/$3.$4 [L]
RewriteRule ^/(?i)HomesForRent/([^/]+)/([^/]+)/([^/]+) /SearchPropertyListing.aspx?propertyId=$3 [L]


I hope this helps

Dec 7, 2009 at 1:59 PM

It's a good idea to do as pregg suggests, and use IIRF logging while developing your rules, and then turn logging down, or off, when moving into production.