Slugs that start with numbers parsed as IDs


(Jay Pfaffman) #1

http://site/some-slug gets redirected to http://site/some-slug/ID. That’s awesome.

But, http://site/21st-some-slug gets redirected to http://site/whatever-slug-it-is-for-id/21.

Is there a way to fix this? I’m poking around in routes.rb, thinking I could find a regex to change, but that doesn’t’ seem like the way.


(Jeff Atwood) #2

Interesting, any ideas here @eviltrout? Probably a Rails routing thing.


(Robin Ward) #3

That was trickier than I expected it to be, since it only fails when the topic whose id matches the same number exists. Here’s a fix:


URLs from old site easily redirected when imported to Discourse
(Robin Ward) #4