Skip to content
Easy aliases/redirects for Middleman that are friendly to the Googles.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Add alias/redirect information to your middleman pages and posts.

Gem Version Build Status Code Climate Coverage Status Dependency Status


Add this line to your application's Gemfile:

gem 'middleman-alias'

And then execute:

$ bundle

Or install it yourself as:

$ gem install middleman-alias


First you need to activate the module in your config.rb. Make sure that it is the LAST thing activated. It's important that other modules have the opportunity to do their own URL manipulations before the alias redirect pages are generated.

activate :alias

Then you can add an alias to the frontmatter for a page or post and middleman-alias will generate a SEO friendly redirect page at that location.

Say that you have a page at /foo.html, but that the page used to live at /old-foo.html. In the frontmatter for foo.html you can alias it to the old address.

title : "A post about foo"
alias : old-foo.html

Now someone can visit your middleman site at /old-foo.html and they'll be redirected to /foo.html.

If you end an alias with a / that alias will be treated as a virtual directory.

title : "A post about foo"
alias : old-foo/

The example above will result in a redirect file being generated at /old-foo/index.html, which will be accessible to browsers at /old-foo/.

title : "A post about foo"
alias : ["old-foo/", "older-foo/"]

Passing an array will allow you to redirect multiple old pages (or directories) to your new page.


  1. Fork it ( )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
You can’t perform that action at this time.