Forum Moderators: phranque
Have been using the following successfully where there are no spaces, but it crashes when spaces are included in the new destination name...
RewriteCond %{query_STRING} ^q=12345$
RewriteRule ^path/file\.php$ /path2/Place Name/Other Name? [R=301,L]
equally the following doesnt work either:
RewriteCond %{query_STRING} ^q=12345$
RewriteRule ^path/file\.php$ /path2/Place%20Name/Other%20Name? [R=301,L]
Help much appreciated!
[edited by: Adam_C at 12:41 pm (utc) on Sep. 11, 2007]
The usual solution is to use %20 for the space and use the [NE] flag on the rule, or to escape the space with a preceding backslash ( e.g. "\ " ). But quoting the string is easier and looks much more readable.
Thanks for posting your solution!
Jim
Can I suggest that you use hyphens or dots between words? Is there a good reason why spaces have been used? If the URL hasn't yet been indexed, I would strongly suggest that it be changed, to lose the spaces.
If it is a script that generates the pages from a database, then it is fairly easy to take the text that I assume you currently use for both the title and for the URL and add hyphens or dots between the words for whatever you are going to use for the URLs and for the links to those pages.