I just created a module to do domain redirecting on npm: 
https://npmjs.org/package/express-force-domain

npm install express-force-domain

app.all('*', require('express-force-domain')('http://www.example.com') );



On Monday, June 4, 2012 12:07:09 AM UTC-7, Felix E. Klee wrote:
>
> I am hosting an express.js application on nodejitsu.com. Now, I have 
> assigned two domain names to it: 
>
>   example.com 
>   www.example.com 
>
> This works (although, this morning there were some glitches). Now, I 
> would like to always redirect: 
>
>   example.com -> www.example.com 
>   example.com/some/page.html -> www.example.com/some/page.html 
>   ... 
>
> Is there an easy way to achieve that using routing from within 
> node/express? 
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to