URL escaped spaces being removed

Topics: Developer Forum, User Forum
Aug 6, 2010 at 11:32 AM
Edited Aug 9, 2010 at 12:32 PM

Hi there,

I must admit that I am not too well versed in regular expressions so have been struggling a bit.
I thought I had the filter working, but then when our system posted an update to twitter, the spaces were removed, I suspect it was the '%' of '%20'

Looking though the files, it seems that "CondSubstringBackrefFlag" might be the solution, but it still doesn't want to work - have I missed something or implimented it wrong?

Below is a copy of my ini file, if someone could look it over and let me know what's missing, I'd be very greatful.


RewriteEngine ON
RewriteLog  C:\path_here\log\iirfLog.out
RewriteLogLevel 3
StatusUrl /iirfStatus

IterationLimit 5

# this will allow ugly URLs to not be processed at all
RewriteRule ^/default.asp(.*)$ - [L,I]

# do not rewrite requests for stylesheets or image files
RewriteRule ^/(css|img)/(.*)$ - [L,I]

# this rewrites any integer directory to displayP.asp?ID=XXXX
RewriteRule ^/([\d\/]+)$ /displayPage.asp?ID=$1 [L]

CondSubstringBackrefFlag %

#Exclude the following directories
#this next line is the one that seems to strip special characters from the querystring
RewriteRule ^/(dir1/|dir2/|dir3/|dir4/|dir5/)(.*)$ - [L,I] #rewrite the url and pass any querystring RewriteRule ^/([\-\w\/]+)((\?(.*))|())$ /displayPage.asp?URLTitle=$1&$4 [L]

Many thanks in advance for any suggestions


Aug 9, 2010 at 12:31 PM
Edited Aug 9, 2010 at 12:33 PM

OK, I have discovered the solution for anyone who reads this in the future.

Nothing to do with "CondSubstringBackrefFlag", I mis-read that... rather simply adding the directive "UrlDecoding OFF" (see http://iirf.codeplex.com/Thread/View.aspx?ThreadId=66377)

I need to do more testing but seems good so far...