0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Performs a 301 redirection on every url ending by a /
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

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