redirect to url with spaces
2 posts
• Page 1 of 1
redirect to url with spaces
I am trying to create a redirect to a client document that has spaces in it and am not being successful. Here are the rules I have tried:
RewriteRule ^userfiles/file/originalfile.pdf$ /userfiles/file/new file.pdf [NC,R=301,L]
RewriteRule ^userfiles/file/originalfile.pdf$ "/userfiles/file/new file.pdf" [NC,R=301,L]
RewriteRule ^userfiles/file/originalfile.pdf$ /userfiles/file/new%20file.pdf [NC,R=301,L]
RewriteRule ^userfiles/file/originalfile.pdf$ "/userfiles/file/new%20file.pdf" [NC,R=301,L]
RewriteRule ^userfiles/file/originalfile.pdf$ /userfiles/file/new\sfile.pdf [NC,R=301,L]
RewriteRule ^userfiles/file/originalfile.pdf$ "/userfiles/file/new\sfile.pdf" [NC,R=301,L]
Nothing seems to work. Basically the when the redirect happens, the spaces in the destination URL are not being maintained. Any help would be appreciated.
RewriteRule ^userfiles/file/originalfile.pdf$ /userfiles/file/new file.pdf [NC,R=301,L]
RewriteRule ^userfiles/file/originalfile.pdf$ "/userfiles/file/new file.pdf" [NC,R=301,L]
RewriteRule ^userfiles/file/originalfile.pdf$ /userfiles/file/new%20file.pdf [NC,R=301,L]
RewriteRule ^userfiles/file/originalfile.pdf$ "/userfiles/file/new%20file.pdf" [NC,R=301,L]
RewriteRule ^userfiles/file/originalfile.pdf$ /userfiles/file/new\sfile.pdf [NC,R=301,L]
RewriteRule ^userfiles/file/originalfile.pdf$ "/userfiles/file/new\sfile.pdf" [NC,R=301,L]
Nothing seems to work. Basically the when the redirect happens, the spaces in the destination URL are not being maintained. Any help would be appreciated.
Re: redirect to url with spaces
Never mind. I figured it out. Here is what I ended up with:
RewriteRule ^userfiles/file/originalfile.pdf$ /userfiles/file/new\ file.pdf [NC,R=301,L]
I just escaped the space itself.
RewriteRule ^userfiles/file/originalfile.pdf$ /userfiles/file/new\ file.pdf [NC,R=301,L]
I just escaped the space itself.
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 24 guests