3 ms·
Your registrar may provide . . . forwarding. And thus we return to my original question: Is there a way to do forwarding at the registrar level in a way that p
by mhartl 12y ago
Your registrar may provide . . . forwarding.
And thus we return to my original question: Is there a way to do forwarding at the registrar level in a way that preserves the rest of the URL structure?
If you're willing to work at a less general level than the registrar, a Ruby gem called Refraction used to work for forwarding in Rails projects (I used it for the Ruby on Rails Tutorial and The Tau Manifesto), but Refraction rules included in a recent Rails project (the most recent iteration of http://tauday.com/ http://tauday.com/) were seemingly ignored. Some Googling revealed a couple of possible more up-to-date solutions:
https://github.com/cwninja/rack-force_domain https://github.com/cwninja/rack-force_domain
https://github.com/tylerhunt/rack-canonical-host https://github.com/tylerhunt/rack-canonical-host
I have yet to try them out, but they look promising.
As an aside, when someone asks a question of the form "How do I do X without feature Y?", it's rarely helpful to respond with something like "Why not use Y?" Typically, the person asking the question has a reason for not using Y, and by making not using Y part of the question they're trying to avoid exactly the kind of digression that happened in this thread.
EDIT (because HN won't let me reply): I agree that it's sometimes worth understanding why they want to do X without Y, but it's best done with a lightness of touch. Otherwise you risk not giving the asker the benefit of the doubt (e.g., via statements like "So? Your redirects don't need to be at Heroku."). It's usually better to either answer the original question as stated or tread very carefully, with phrasing like "I'd like to understand your reasons for not wanting to use Y" rather than the blunter "What's wrong with Y?"
UPDATE: I can confirm that [rack-canonical-host](https://github.com/tylerhunt/rack-canonical-host https://github.com/tylerhunt/rack-canonical-host) does the kind of forwarding I wanted, as you can verify by visiting, e.g., http://tauday.com/tau-manifesto?foo=bar http://tauday.com/tau-manifesto?foo=bar, which is correctly forwarded to http://www.tauday.com/tau-manifesto?foo=bar http://www.tauday.com/tau-manifesto?foo=bar.
- TazeTSchnitzel 12y ago> And thus we return to my original question: Is there a way to do forwarding at the registrar level in a way that preserves the rest of the URL structure? Depends on your registrar. > As an aside, when someone asks a question of the form "How do I do X without feature Y?", it's rarely helpful to respond with something like "Why not use Y?" Typically, the person asking the question has a reason for not using Y, and by making not using Y part of the question they're trying to avoid exactly the kind of digression that happened in this thread. Sure, but it is sometimes worth asking why someone wants to know how to do X without Y.