[LRUG] FW: Redirects on heroku

Trevor Turk trevorturk at gmail.com
Tue Aug 3 06:48:20 PDT 2010


I made a rack middleware for just this situation, which someone kindly
turned into a gem:

http://github.com/logicaltext/rack-no-www

I think that should work pretty well.

BTW - I'm new to this list, so I should introduce myself. I'm a Ruby
developer currently living in Chicago, but I'm hoping to move to
London shortly. I was very happy to find an active Ruby group in
London, and I'm looking forward to meeting you all if/when I make it
out there!

- Trevor

On Tuesday, August 3, 2010,  <chat-request at lists.lrug.org> wrote:
> Send Chat mailing list submissions to
>         chat at lists.lrug.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.lrug.org/listinfo.cgi/chat-lrug.org
> or, via email, send a message with subject or body 'help' to
>         chat-request at lists.lrug.org
>
> You can reach the person managing the list at
>         chat-owner at lists.lrug.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Chat digest..."
>
>
> Today's Topics:
>
>    1. Rails 3 engines dir layout (Priit Tamboom)
>    2. PHP / Ruby developer needed for Firebox.com (Paul Wright)
>    3. FW: Redirects on heroku (Anthony Green)
>    4. Re: FW: Redirects on heroku (Paul Bowsher)
>    5. Re: FW: Redirects on heroku (Jon Wood)
>    6. Re: FW: Redirects on heroku (Simon Starr)
>    7. Re: FW: Redirects on heroku (John Beynon)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 3 Aug 2010 11:19:57 +0200
> From: Priit Tamboom <priit at mx.ee>
> To: chat at lists.lrug.org
> Subject: [LRUG] Rails 3 engines dir layout
> Message-ID:
>         <AANLkTi=0ZxvLeYaxWVAE2ft=qMHbMncCyXntJvxVHPHT at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Morning!
>
> I'm currently porting a Rails 2 project over to Rails 3 and also
> extracting some common engine related stuff into "engineered" gem [1].
>
> Currently engine dir layout are following rails default way as
> app/controllers/#{my_engine_name}/example_controller.rb. However more
> I develop new engines more I feel I should probably investigate into
> some alternative way to namespace in order to keep engine dir layout a
> bit more flat.
>
> For example, when some engine has got an admin interface, then it goes
> even more deep as
> app/controllers/#{my_engine_name}/admin/example_controller.rb
>
> Therefore what if engine dir layout itself does not have namespace,
> but I will provide it other ways instead, so all engine apps will have
> automatically namespaced when included into master app.
>
> As we know Rails 3 paths are not hardcoded [2], so paths can be more
> flexible if really needed. However I'm not yet sure is it worth the
> trouble to implement such a feature into "engineered" gem. It might
> create more trouble than current situation with deeper layouts.
>
> Have you stumbled into similar idea/situation or perhaps I just miss something.
>
> Cheers,
> Priit
>
> [1] http://github.com/priit/engineered
> [2] http://github.com/rails/rails/blob/master/railties/lib/rails/engine/configuration.rb
>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 3 Aug 2010 12:20:58 +0100
> From: Paul Wright <wrighty at gmail.com>
> To: chat at lists.lrug.org
> Subject: [LRUG] PHP / Ruby developer needed for Firebox.com
> Message-ID:
>         <AANLkTi=S9rPUTcNWoDs_RBfR0f_1-HMJ0uPQPXsaxp_x at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi list,
>
> At work we've been recruiting for a new developer for a few weeks, in
> that time we've found two suitable candidates and made offers only to
> find out they'd already accepted roles elsewhere. ?So now we're
> starting over again and I wondered if you or anyone you know is
> looking for a job?
>
> Details of job are on the site[1] but broadly we're looking for an all
> rounder who can already (or learn quickly to) code mostly OO PHP with
> occasional Ruby, happy using a Linux command line, isn't afraid of git
> and can configure / install / maintain LAMP web stacks.
>
> The tech team is small (2 developers, an office sysadmin and the CTO)
> but we get a lot done and react quickly to new business requirements.
> We've built pretty much all the software that runs Firebox (front end
> site, back end and warehouse systems) so the role is challenging and
> varied.  Last year we launched a site redesign and have also been
> adding fun stuff like the Gift-o-matic[2].
>
> Job is based in Streatham Hill, SW2 and salary is in the ?25k - ?35k range.
>
> Please see job ad for more details.
>
> Cheers,
>
> Paul.
> [1]?http://www.firebox.com/admin/jobs#tech
> [2] http://www.firebox.com/giftfinder
>
>
> ------------------------------
>
> Message: 3
> Date: Tue, 03 Aug 2010 13:19:35 +0100
> From: Anthony Green <Anthony.Green at bbc.co.uk>
> To: London Ruby Users Group <chat at lists.lrug.org>
> Subject: [LRUG] FW: Redirects on heroku
> Message-ID: <C87DC7E7.8A8%Anthony.Green at bbc.co.uk>
> Content-Type: text/plain;       charset="US-ASCII"
>
>
> Can any heroku users know what the answer is ?
>
>
> ------ Forwarded Message
> From: Michael Smethurst <
> Subject: Redirects on heroku
>
> Hiya
>
> Just following on from lunchtime chat...
>
> I've managed to get cctvspotr running on heroku and set it up with 2 custom
> domains: www.cctvspotr.org and cctvspotr.org
>
> I've registered www.cctvspotr.org and pointed it at heroku's dns. All fine
>
> http://www.cctvspotr.org
> http://cctvspotr.org
>
> Now I'd like to get cctvspotr.org{/whatever} to 301 to
> www.cctvspotr.org{/whatever}. But can't find any helpful hints. The nearest
> I found was:
>
> http://docs.heroku.com/custom-domains#redirecting-traffic-to-specific-domain
>
> I tried adding that code to my application controller with TheDomain =
> 'www.cctvspotr.org' but that just redirected cctvspotr.org to
> cctvspotr.orgwww.cctvspotr.org
>
> Am sure there's a proper forum to ask this on somewhere but not sure where
>
> Any help much appreciated
>
> Cheers
> michael
>
> ------ End of Forwarded Message
>
>
> http://www.bbc.co.uk/
> This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
> If you have received it in error, please delete it from your system.
> Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
> Please note that the BBC monitors e-mails sent or received.
> Further communication will signify your consent to this.
>
>
>
> ------------------------------
>
> Message: 4
> Date: Tue, 3 Aug 2010 13:22:06 +0100
> From: Paul Bowsher <paul.bowsher at gmail.com>
> To: London Ruby Users Group <chat at lists.lrug.org>
> Subject: Re: [LRUG] FW: Redirects on heroku
> Message-ID:
>         <AANLkTi=T46pHUxzw8pvN9D7eQP1MZA5EDnZGcfA827ns at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> I'd suggest using http://github.com/jtrupiano/rack-rewrite
>
> Paul Bowsher
>
>
> On Tue, Aug 3, 2010 at 1:19 PM, Anthony Green <Anthony.Green at bbc.co.uk>wrote:
>
>>
>> Can any heroku users know what the answer is ?
>>
>>
>> ------ Forwarded Message
>> From: Michael Smethurst <
>> Subject: Redirects on heroku
>>
>> Hiya
>>
>> Just following on from lunchtime chat...
>>
>> I've managed to get cctvspotr running on heroku and set it up with 2 custom
>> domains: www.cctvspotr.org and cctvspotr.org
>>
>> I've registered www.cctvspotr.org and pointed it at heroku's dns. All fine
>>
>> http://www.cctvspotr.org
>> http://cctvspotr.org
>>
>> Now I'd like to get cctvspotr.org{/whatever} to 301 to
>> www.cctvspotr.org{/whatever}. But can't find any helpful hints. The
>> nearest
>> I found was:
>>
>>
>> http://docs.heroku.com/custom-domains#redirecting-traffic-to-specific-domain
>>
>> I tried adding that code to my application controller with TheDomain =
>> 'www.cctvspotr.org' but that just redirected cctvspotr.org to
>> cctvspotr.orgwww.cctvspotr.org
>>
>> Am sure there's a proper forum to ask this on somewhere but not sure where
>>
>> Any help much appreciated
>>
>> Cheers
>> michael
>>
>> ------ End of Forwarded Message
>>
>>
>> http://www.bbc.co.uk/
>> This e-mail (and any attachments) is confidential and may contain personal
>> views which are not the views of the BBC unless specifically stated.
>> If you have received it in error, please delete it from your system.
>> Do not use, copy or disclose the information in any way nor act in reliance
>> on it and notify the sender immediately.
>> Please note that the BBC monitors e-mails sent or received.
>> Further communication will signify your consent to this.
>>
>> _______________________________________________
>> Chat mailing list
>> Chat at lists.lrug.org
>> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20100803/e7f479ed/attachment-0001.htm>
>
> ------------------------------
>
> Message: 5
> Date: Tue, 3 Aug 2010 13:23:35 +0100
> From: Jon Wood <jon at blankpad.net>
> To: London Ruby Users Group <chat at lists.lrug.org>
> Subject: Re: [LRUG] FW: Redirects on heroku
> Message-ID:
>         <AANLkTi=5u-towvbV0Z5hzdA7o2Z1cxakEyFhSJ3FSHwS at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> I've had some success using Rack middleware for that sort of thing on
> Heroku, although I can't remember specifically which one right not.
>
> On 3 Aug 2010 13:19, "Anthony Green" <Anthony.Green at bbc.co.uk> wrote:
>>
>> Can any heroku users know what the answer is ?
>>
>>
>> ------ Forwarded Message
>> From: Michael Smethurst <
>> Subject: Redirects on heroku
>>
>> Hiya
>>
>> Just following on from lunchtime chat...
>>
>> I've managed to get cctvspotr running on heroku and set it up with 2
> custom
>> domains: www.cctvspotr.org and cctvspotr.org
>>
>> I've registered www.cctvspotr.org and pointed it at heroku's dns. All fine
>>
>> http://www.cctvspotr.org
>> http://cctvspotr.org
>>
>> Now I'd like to get cctvspotr.org{/whatever} to 301 to
>> www.cctvspotr.org{/whatever}. But can't find any helpful hints. The
> nearest
>> I found was:
>>
>>
> http://docs.heroku.com/custom-domains#redirecting-traffic-to-specific-domain
>>
>> I tried adding that code to my application controller with TheDomain =
>> 'www.cctvspotr.org' but that just redirected cctvspotr.org to
>> cctvspotr.orgwww.cctvspotr.org
>>
>> Am sure there's a proper forum to ask this on somewhere but not sure where
>>
>> Any help much appreciated
>>
>> Cheers
>> michael
>>
>> ------ End of Forwarded Message
>>
>>
>> http://www.bbc.co.uk/
>> This e-mail (and any attachments) is confidential and may contain personal
> views which are not the views of the BBC unless specifically stated.
>> If you have received it in error, please delete it from your system.
>> Do not use, copy or disclose the information in any way nor act in
> reliance on it and notify the sender immediately.
>> Please note that the BBC monitors e-mails sent or received.
>> Further communication will signify your consent to this.
>>
>> _______________________________________________
>> Chat mailing list
>> Chat at lists.lrug.org
>> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20100803/7abd712c/attachment-0001.htm>
>
> ------------------------------
>
> Message: 6
> Date: Tue, 3 Aug 2010 13:31:03 +0100
> From: Simon Starr <simon at starr.cx>
> To: London Ruby Users Group <chat at lists.lrug.org>
> Subject: Re: [LRUG] FW: Redirects on heroku
> Message-ID: <6C5261D7-6F9E-4F69-B1CA-91BBD1F6BB4E at starr.cx>
> Content-Type: text/plain; charset=us-ascii
>
> I've used Zerigo's free DNS hosting (http://www.zerigo.com/managed-dns) for doing this with Heroku in the past. Unfortunately their redirects are 302 instead of 301 though.
>
> Cheers
>   Simon
>
> On 3 Aug 2010, at 13:19, Anthony Green wrote:
>
>>
>> Can any heroku users know what the answer is ?
>>
>>
>> ------ Forwarded Message
>> From: Michael Smethurst <
>> Subject: Redirects on heroku
>>
>> Hiya
>>
>> Just following on from lunchtime chat...
>>
>> I've managed to get cctvspotr running on heroku and set it up with 2 custom
>> domains: www.cctvspotr.org and cctvspotr.org
>>
>> I've registered www.cctvspotr.org and pointed it at heroku's dns. All fine
>>
>> http://www.cctvspotr.org
>> http://cctvspotr.org
>>
>> Now I'd like to get cctvspotr.org{/whatever} to 301 to
>> www.cctvspotr.org{/whatever}. But can't find any helpful hints. The nearest
>> I found was:
>>
>> http://docs.heroku.c <http://docs.heroku.com/custom-domains#redirecting-traffic-to-specific-domain>



More information about the Chat mailing list