Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/atmos/rack-redirect
simple redirects for your solo slices via a little rack app
https://github.com/atmos/rack-redirect
Last synced: 3 months ago
JSON representation
simple redirects for your solo slices via a little rack app
- Host: GitHub
- URL: https://github.com/atmos/rack-redirect
- Owner: atmos
- License: mit
- Created: 2009-07-28T02:54:17.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2009-07-31T06:35:36.000Z (over 15 years ago)
- Last Synced: 2024-10-02T21:15:34.823Z (3 months ago)
- Language: Ruby
- Homepage: http://github.com/atmos/rack-redirect/tree/master
- Size: 82 KB
- Stars: 13
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
rack-redirect
=============
More and more of my friends are deploying on [Engine Yard Solo][solo] and I
keep getting asked for help. My friends at [everlater][everlater] wanted every
incoming request for *.everlater.com to go to www.everlater.com. Here's a
little app that you can deploy on solo to handle all the weird HTTP_HOST
variants your app might 404 on.Installation
============% sudo gem install rack-redirect
Deployment
==========
Your rackup file should look something like this.require 'rubygems'
require File.join(File.dirname(__FILE__), 'lib', 'rack-redirect')use Rack::EY::Solo::DomainRedirect
run lambda { |env| [200, { 'Content-Type' => 'text/plain' }, ['Hello there, gorgeous'] ] }testing
=======Just run rake...
rack-redirect with a value of 'www'
- forwards on from http://www.example.org to the next app
- redirects from http://example.org to http://www.example.org/
- redirects from http://wwww.example.org to http://www.example.org/
- redirects from http://alpha.example.com to http://www.example.org/
- redirects from http://example.org/nate to http://www.example.org/nate
- redirects from http://example.org/nate?trip_id=42 to http://www.example.org/nate?trip_id=42rack-redirect without specifying a prefix
- forwards on requests from http://example.org to the next app
- redirects from http://alpha.example.com to http://example.org/
- redirects from http://alpha.example.org/nate to http://example.org/nate
- redirects from http://alpha.example.org/nate?trip_id=42 to http://example.org/nate?trip_id=42[sinatra]: http://www.sinatrarb.com
[everlater]: http://everlater.com
[solo]: http://engineyard.com/solo