If you look in your webmaster tools account, you can see how you get penalized for this here:

Why? Who knows. The question is not to ask why, it’s how do we fix it?

So what does Heroku and Rails have to do with this? Heroku makes hosting Rails apps a breeze, it’s where I host all of my projects, including MovingTruck.com, which helps people find moving trucks (logical, huh?). Unfortunately, Rails makes it a bit tough to remove trailing slashes, and Heroku is a bit of a locked down environment (in a good way, yeah Heroku!), so finding the answer to this vexing problem takes a bit of digging.

Enter my good friends at ELCTech, with this post. Solving this is as simple as:

running “sudo gem install rack-rewrite”

and inserting the following code in your config/environment.rb file (don’t forget to add the gem to your .gems file either)

Actually a followup comment…. It seems it’s slightly better SEO to redirect URLs without a slash to URLs with a trailing slash. It seems your regex magic could do just that as well, no? Unfortunately my regex skillz are noob at best. Would you mind posting a solution to do this as well or is it more complex than I imagine?