This is actually a little weird now that I see what the problem is.
Example title: "this is a test"
By default, when Silverstripe attempts to generate a URL from that, it calls this url:
/admin/pages/edit/EditForm/field/URLSegment/suggest/?value=this%20is%20a%20test
Which results in the URLSegment of "this-is-a-test"
But as soon as I introduce the .htaccess segment to strip trailing slashes, Silverstripe attempts to call this URL:
/admin/pages/edit/EditForm/field/URLSegment/suggest?value=this%2520is%2520a%2520test
Which results in the URLSegment of "this20is20a20test"
Easy to see that it is being urlencoded twice in the second URL. %20 is an encoded space. %25 is an encoded '%'. Hence a space is being encoded to %20 first, then the '%' is being encoded again to give me %2520.
The workaround is to add a condition to .htaccess where /admin is ignored from the rule. But I'm wondering if anyone can think of a logical reason for this?
The .htaccess block again:
RewriteRule ^(.+)/$ /$1 [R=301,L]
Posted to: Setup issue? All CMS-suggested URLs replace spaces with '20' | Show Thread | Post Reply