Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Let /man/* and /ref/* redirect to /docs/*

  • Loading branch information...
commit 55e6a5e01563def0ab87347a0c050a320b4d3a01 1 parent 2a477b4
@koraktor koraktor authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 config/routes.rb
View
16 config/routes.rb
@@ -12,7 +12,7 @@
root :to => 'site#redirect_book'
match '*path' => 'site#redirect_combook'
end
-
+
get "site/index"
match "/doc" => "doc#index"
@@ -22,11 +22,11 @@
match "/test" => "doc#test"
match "/doc/ext" => "doc#ext"
- match "/man/:file" => "doc#man"
- match "/man/:file/:version" => "doc#man", :version => /[^\/]+/
-
- match "/ref/:file" => "doc#man"
- match "/ref/:file/:version" => "doc#man", :version => /[^\/]+/
+ %w{man ref}.each do |path|
+ match "/#{path}/:file" => redirect("/docs/%{file}")
+ match "/#{path}/:file/:version" => redirect("/docs/%{file}/%{version}"),
+ :version => /[^\/]+/
+ end
match "/book" => "doc#book"
match "/book/index" => "doc#book"
@@ -37,8 +37,8 @@
match "/book/:lang/:slug" => "doc#book_section"
match "/publish" => "doc#book_update"
match "/related" => "doc#related_update"
- match "/:year/:month/:day/:slug" => "doc#blog", :year => /\d{4}/,
- :month => /\d{2}/,
+ match "/:year/:month/:day/:slug" => "doc#blog", :year => /\d{4}/,
+ :month => /\d{2}/,
:day => /\d{2}/
match "/about" => "about#index"
Please sign in to comment.
Something went wrong with that request. Please try again.