Spaces in substitution

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 2
Joined: 26 Feb 2013, 08:42

Spaces in substitution

26 Feb 2013, 08:53

I'm struggling with a situation where we have a number of legacy files with spaces in their filename (e.g. 'Test page.pdf'). Unfortunately due to their age and the history we cannot rename them! I'm attempting to re-write a new name to the old file so:
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.98
RewriteEngine on
RewriteRule ^/a1file.pdf /Test%20Page.pdf [NC,R=301,L]

but the output is incorrect, the browser is reporting the Requested URL: /Test0Page.pdf

Tried adding NE to the flags but reports exactly the same :-(

Your help would be appreciated :-)

Thanks

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Spaces in substitution

26 Feb 2013, 11:09

Hello,

Try using :

Code: Select all
RewriteRule ^/a1file.pdf /Test\%20Page.pdf [NC,R=301,L]


Regards
Andrew

User avatar
Posts: 2
Joined: 26 Feb 2013, 08:42

Re: Spaces in substitution

26 Feb 2013, 15:22

Andrew,
Thanks for this - it didn't quite work but did put me on the route to sorting it out :-)

Doing as ou suggested the browser (Firefox 18.0.2) was attempting to access 'Test%2520Page.pdf' :-(

Adding the NE flag to your solution worked though :-) e.g.
Code: Select all
RewriteRule ^/a1file.pdf /Test\%20Page.pdf [NC,R=301,L,NE]


Thanks for your assistance

Paul

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 10 guests