Skip to content
This repository has been archived by the owner on Jul 31, 2019. It is now read-only.
/ rack_slashless Public archive

Rack application to redirect every url ending by a /

Notifications You must be signed in to change notification settings

gregorym/rack_slashless

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Rack application to redirect every url ending by a /

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages