Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
Redirects take 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Chloe Jackson authored and Chloe Jackson committed Apr 4, 2014
1 parent c034d8e commit 524ca41
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 42 deletions.
82 changes: 41 additions & 41 deletions config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,54 +128,54 @@ def sub_pages(dir)
end

#Redirects
require "sinatra"
# require "sinatra"

class BOSHRedir < Sinatra::Base
get "/" do
redirect to('http://docs.cloudfoundry.org/bosh')
end
end
# class BOSHRedir < Sinatra::Base
# get "/" do
# redirect to('http://docs.cloudfoundry.org/bosh')
# end
# end

map "/docs/running/bosh/index.html" do
run BOSHRedir
end
# map "/docs/running/bosh/index.html" do
# run BOSHRedir
# end

class ServicesRedir < Sinatra::Base
get "/" do
redirect to('http://docs.cloudfoundry.org/services/')
end
end
# class ServicesRedir < Sinatra::Base
# get "/" do
# redirect to('http://docs.cloudfoundry.org/services/')
# end
# end

map "/docs/running/architecture/services" do
run ServicesRedir
end
# map "/docs/running/architecture/services" do
# run ServicesRedir
# end

class UsingServicesRedir < Sinatra::Base
get "/" do
redirect to('http://docs.cloudfoundry.org/devguide/services/')
end
end
# class UsingServicesRedir < Sinatra::Base
# get "/" do
# redirect to('http://docs.cloudfoundry.org/devguide/services/')
# end
# end

map "/docs/using/services" do
run UsingServicesRedir
end
# map "/docs/using/services" do
# run UsingServicesRedir
# end

class ServicesAPIRedir < Sinatra::Base
get "/" do
redirect to('http://docs.cloudfoundry.org/services/api.html')
end
end
# class ServicesAPIRedir < Sinatra::Base
# get "/" do
# redirect to('http://docs.cloudfoundry.org/services/api.html')
# end
# end

map "/docs/running/architecture/services/api.html" do
run ServicesAPIRedir
end
# map "/docs/running/architecture/services/api.html" do
# run ServicesAPIRedir
# end

class DeployingCFRedir < Sinatra::Base
get "/*" do
redirect to('http://docs.cloudfoundry.org/deploying/')
end
end
# class DeployingCFRedir < Sinatra::Base
# get "/*" do
# redirect to('http://docs.cloudfoundry.org/deploying/')
# end
# end

map "/docs/running/deploying-cf/" do
run DeployingCFRedir
end
# map "/docs/running/deploying-cf/" do
# run DeployingCFRedir
# end
31 changes: 30 additions & 1 deletion source/404.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,34 @@ title: Page not Found
---

<script type="text/javascript">
window.location.href="http://docs.cloudfoundry.com/";
if (window.location.pathname == "/docs/running/bosh/index.html") {
window.location.href = "http://docs.cloudfoundry.org/bosh";
}
else if (window.location.pathname == "/docs/running/architecture/services") {
window.location.href = "http://docs.cloudfoundry.org/services/";
}
else if (window.location.pathname == "/docs/using/services") {
window.location.href = "http://docs.cloudfoundry.org/devguide/services/";
}
else if (window.location.pathname == "/docs/running/architecture/services/api.html") {
window.location.href = "http://docs.cloudfoundry.org/services/api.html";
}
else if (window.location.pathname == "/docs/running/deploying-cf/index.html") {
window.location.href = "http://docs.cloudfoundry.org/deploying/";
}
else if (window.location.pathname == "/docs/running/deploying-cf/openstack/index.html") {
window.location.href = "http://docs.cloudfoundry.org/deploying/openstack/";
}
else if (window.location.pathname == "/docs/running/deploying-cf/vcloud/index.html") {
window.location.href = "http://docs.cloudfoundry.org/deploying/vcloud/";
}
else if (window.location.pathname == "/docs/running/deploying-cf/vsphere/index.html") {
window.location.href = "http://docs.cloudfoundry.org/deploying/vsphere/";
}
else if (window.location.pathname == "/docs/running/deploying-cf/ec2/index.html") {
window.location.href = "http://docs.cloudfoundry.org/deploying/ec2/";
}
else {
window.location.href="http://docs.cloudfoundry.com/";
}
</script>

0 comments on commit 524ca41

Please sign in to comment.