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
Expand Up @@ -128,54 +128,54 @@ def sub_pages(dir)
end end


#Redirects #Redirects
require "sinatra" # require "sinatra"


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


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


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


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


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


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


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


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


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


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


<script type="text/javascript"> <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> </script>

0 comments on commit 524ca41

Please sign in to comment.