Rack application to redirect every url ending by a /
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
.travis.yml
Gemfile
Gemfile.lock
README.md
Rakefile
rack_slashless.gemspec

README.md

Rack::Slashless

Rack::Slashless is Rack application that redirects every GET requests ending by a / to the same url without the /.

Rack::Slashless is an easy SEO win, the gem will avoid duplicate contents across your site. For example, you can access the page example.com/blog/ or example.com/blog, both have exactly the same content but with a different url, this causes a duplicate content for Google.

If you want more details regarding Duplicate Content, here is the Guide from Google.

Installation

Install the gem locally using:

gem install rack_slashless

... or add it to your project's Gemfile:

gem 'rack_slashless'

Rails

config/application.rb

config.middleware.insert_before(0, "Rack::Slashless")

Sinatra

app.rb (your application file)

require 'sinatra'
require 'rack_slashless'

use Rack::Slashless

Author

Gregory Marcilhacy
License: MIT