spaces in destination url

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 3
Joined: 04 Jun 2012, 11:50

spaces in destination url

04 Jun 2012, 12:02

We recently updated our website and most of our old URLs changed. I am redirecting the old URLs to the corresponding new pages, but I am having trouble getting the redirect to work when the new page has a space in the URL. Here is a specific example...

This does not work -
RewriteRule ^HospitalsFacilities/Hospitals/Ss/AboutUs/Pages/Volunteering.aspx http://www.domain.com/locations/hospita ... ering.aspx [NC,R=301,L]

This does
RewriteRule ^HospitalsFacilities/Hospitals/Ss/AboutUs/Pages/Volunteering.aspx http://www.domain.com [NC,R=301,L]

I've tried the following variations of the destination URL and none seem to work...
http://www.domain.com/locations/hospitals/ss/about\%20us/Pages/volunteering.aspx
http://www.domain.com/locations/hospitals/ss/about\sus/Pages/volunteering.aspx
http://www.domain.com/locations/hospitals/ss/about us/Pages/volunteering.aspx

Any help would be greatly appreciated.

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: spaces in destination url

05 Jun 2012, 05:55

Hello,

Please try to encode the spaces as follows:

RewriteRule ^HospitalsFacilities/Hospitals/Ss/AboutUs/Pages/Volunteering.aspx http://www.domain.com/locations/hospitals/ss/about\ us/Pages/volunteering.aspx [NC,R=301,L]

User avatar
Posts: 3
Joined: 04 Jun 2012, 11:50

Re: spaces in destination url

06 Jun 2012, 10:35

Thanks for your reply.

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 12 guests