{"_id":"connect-redirecthost","_rev":"20-a629b020447698ff9d1ba08e1fe11c0a","name":"connect-redirecthost","description":"Connect middleware for the Express.js framework that allows redirecting multiple domains to a default one","dist-tags":{"latest":"3.0.0"},"versions":{"0.0.0":{"author":{"name":"M Gradek"},"name":"connect-redirecthost","description":"Connect middleware for the Express.js framework that allows redirecting multiple domains to a default one","version":"0.0.0","repository":{"url":"git@github.com:perropicante/connect-redirecthost.git"},"main":"index","engines":{"node":"~0.4.8"},"dependencies":{"underscore":"1.1.7"},"devDependencies":{"vows":"latest"},"_npmUser":{"name":"perropicante","email":"perropicante@hotmail.com"},"_id":"connect-redirecthost@0.0.0","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"c8950e55cb79e6268bfe455be8398c7f18009d64","tarball":"https://registry.npmjs.org/connect-redirecthost/-/connect-redirecthost-0.0.0.tgz","integrity":"sha512-WlOOU954Gtg8l7t5DJlhAz83fuGtP+lmpUNu7sQELnNVW6KhMep/VWIFAKJpniZ2LnBy5+2eDNpF30btdu5csg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJ/SjtC4OYz/lmZ9qUMYTiQedbEOsyCjSKuPYiTnWeXAIgNkesHjr01eG08aUMFYdfVC0mllE6TZunCaPmN42mSxU="}]},"maintainers":[{"name":"perropicante","email":"perropicante@hotmail.com"}],"directories":{}},"0.0.1":{"author":{"name":"M Gradek"},"name":"connect-redirecthost","description":"Connect middleware for the Express.js framework that allows redirecting multiple domains to a default one","version":"0.0.1","repository":{"url":"git@github.com:perropicante/connect-redirecthost.git"},"main":"index","engines":{"node":"~0.4.8"},"dependencies":{"underscore":"1.1.7"},"devDependencies":{"vows":"latest"},"_npmUser":{"name":"perropicante","email":"perropicante@hotmail.com"},"_id":"connect-redirecthost@0.0.1","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"de4dadecf5f456de7db13d02a359dd0b8df66087","tarball":"https://registry.npmjs.org/connect-redirecthost/-/connect-redirecthost-0.0.1.tgz","integrity":"sha512-T1IQX9hUcLVruflTI0I8LZy04Q+D40bJZxFnxOCShwL6uCpPPUiv8pegV3sHOoYWNLXhWZT5deky6cRuZk4VdA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAWGXR1qLGOq5A0Ln4EaAT8RYZAaD//yvyakVpfBmYoTAiEAqcqE6vR+JEFUoqOaNEbZNoJrcIRTb4L+gySHu4hznnw="}]},"maintainers":[{"name":"perropicante","email":"perropicante@hotmail.com"}],"directories":{}},"0.0.2":{"author":{"name":"M Gradek"},"name":"connect-redirecthost","description":"Connect middleware for the Express.js framework that allows redirecting multiple domains to a default one","version":"0.0.2","repository":{"url":"git@github.com:perropicante/connect-redirecthost.git"},"main":"index","engines":{"node":"~0.4.7"},"dependencies":{"underscore":"1.1.7"},"devDependencies":{"vows":"latest"},"_npmUser":{"name":"perropicante","email":"perropicante@hotmail.com"},"_id":"connect-redirecthost@0.0.2","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"9e32b3183687e0239b68fd91727d4c22529b9606","tarball":"https://registry.npmjs.org/connect-redirecthost/-/connect-redirecthost-0.0.2.tgz","integrity":"sha512-CMFVa2iC5cfzT78P9EuvJg89PtEz0e9UkM0k2oiaBffpPzPdS9RPm7v86IKpg7GQukke7IZz1PWuFH+DGeePWw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnD+8fOomSEcfVlvuDmgrs1pT6k9ZUVIAvQM06API6AQIgS2AnGbKRaYI61YfTB05IZ8850rSp2b6iSWRLbZkc0VM="}]},"maintainers":[{"name":"perropicante","email":"perropicante@hotmail.com"}],"directories":{}},"0.0.3":{"author":{"name":"M Gradek"},"name":"connect-redirecthost","description":"Connect middleware for the Express.js framework that allows redirecting multiple domains to a default one","version":"0.0.3","repository":{"url":"git@github.com:perropicante/connect-redirecthost.git"},"main":"index","engines":{"node":"~0.4.7"},"dependencies":{"underscore":"1.1.7"},"devDependencies":{"vows":"latest"},"_npmUser":{"name":"perropicante","email":"perropicante@hotmail.com"},"_id":"connect-redirecthost@0.0.3","_engineSupported":true,"_npmVersion":"1.0.105","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"8d5c0efaa5f03ce630c780eca94b614d6b050a35","tarball":"https://registry.npmjs.org/connect-redirecthost/-/connect-redirecthost-0.0.3.tgz","integrity":"sha512-O2Uh0Kb0GnkDaZNToszTEXqpboh+NgFX2U4bmaCUXPBJOiUZgNbbi17JLmZY2Fd6HZjRCk54MBjuKxQMihn3OA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1YOz/G244RgPCfLwv/PcvACLqUQlFW2uU3vdfQi+2tgIhALHOntTCWvj0gmUrJJxPoDKlSDuwIPVbPGETOL9x9f2n"}]},"maintainers":[{"name":"perropicante","email":"perropicante@hotmail.com"}],"directories":{}},"0.0.4":{"author":{"name":"M Gradek"},"name":"connect-redirecthost","description":"Connect middleware for the Express.js framework that allows redirecting multiple domains to a default one","version":"0.0.4","repository":{"url":"git@github.com:perropicante/connect-redirecthost.git"},"main":"index","engines":{"node":">= 0.4.7"},"dependencies":{"underscore":"1.1.7"},"devDependencies":{"vows":"latest"},"scripts":{"test":"vows test/*.js"},"_npmUser":{"name":"perropicante","email":"perropicante@hotmail.com"},"_id":"connect-redirecthost@0.0.4","_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"30ddcc61dc7933485f58e42e24766c420adc5b41","tarball":"https://registry.npmjs.org/connect-redirecthost/-/connect-redirecthost-0.0.4.tgz","integrity":"sha512-EQLXz0sUfMLd0Kij7sAyAg58A7g9zNN3drEpX1TEOZ65biLQmBgbLYzLGyPXL5AgxTlxeX+qWczCIxxoqqTncQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOZoM5BjKOsC/S+IH92hInijL07QqwHIoCe693AaUlHAIhAKxeQOa3A2k5MYwCKM566OnjnsYyk106S/YfAJu9BgzJ"}]},"maintainers":[{"name":"perropicante","email":"perropicante@hotmail.com"}],"directories":{}},"1.0.0":{"author":{"name":"M Gradek"},"name":"connect-redirecthost","description":"Connect middleware for the Express.js framework that allows redirecting multiple domains to a default one","version":"1.0.0","repository":{"url":"git@github.com:perropicante/connect-redirecthost.git"},"main":"index","engines":{"node":">= 0.4.7"},"dependencies":{"underscore":"1.6.0"},"devDependencies":{"vows":"latest"},"scripts":{"test":"vows test/*.js"},"bugs":{"url":"https://github.com/perropicante/connect-redirecthost/issues"},"homepage":"https://github.com/perropicante/connect-redirecthost","_id":"connect-redirecthost@1.0.0","dist":{"shasum":"5f24c45f885272bd3c12ec3f950b728937e8f9c5","tarball":"https://registry.npmjs.org/connect-redirecthost/-/connect-redirecthost-1.0.0.tgz","integrity":"sha512-P5LOezsiodRt2aAdthppaPND37r1DT7bvF+5a4nSJJv04vKmVM97ZEyuGjFnRtHmh0iEMRe0DAD0JsgU/DmWJg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5vQ+mjCVYKwTLRKpYZVwujiZlQsRgNMqGjlim7+cwwQIhAIBoJ0cD7dADsFwghyufXeRegVmSEOQWj+fsqxcarbPw"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"cdnbacon","email":"mike@busbud.com"},"maintainers":[{"name":"perropicante","email":"perropicante@hotmail.com"},{"name":"cdnbacon","email":"mike@busbud.com"}],"directories":{}},"2.0.0":{"author":{"name":"M Gradek"},"name":"connect-redirecthost","description":"Connect middleware for the Express.js framework that allows redirecting multiple domains to a default one","version":"2.0.0","repository":{"url":"git@github.com:perropicante/connect-redirecthost.git"},"main":"index","engines":{"node":">= 0.4.7"},"dependencies":{"URIjs":"^1.14.1","underscore":"1.6.0"},"devDependencies":{"vows":"latest"},"scripts":{"test":"vows test/*.js"},"gitHead":"da5e306973322312376e4b11d42ef7e68b29cf8f","bugs":{"url":"https://github.com/perropicante/connect-redirecthost/issues"},"homepage":"https://github.com/perropicante/connect-redirecthost","_id":"connect-redirecthost@2.0.0","_shasum":"4ec0b5ef7146379639fe2b64d5ff4b0f18318df1","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"cdnbacon","email":"mike@busbud.com"},"maintainers":[{"name":"perropicante","email":"perropicante@hotmail.com"},{"name":"cdnbacon","email":"mike@busbud.com"}],"dist":{"shasum":"4ec0b5ef7146379639fe2b64d5ff4b0f18318df1","tarball":"https://registry.npmjs.org/connect-redirecthost/-/connect-redirecthost-2.0.0.tgz","integrity":"sha512-OQcaK/gg026583IJ+o3zesa+dzOD4fgiF2HGBQGc50EiSgorYTkIGDwES0uOy+wqm7qzR5AcgGC6HveDYSwyeA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAjzzuG1bkEHVK4GNSACItXv7I22b8fnjHjHpVdLr5OgIhAMAW6FcaTgznxTz+7Rm+GIndKIDAIidN6CZWLVkecXWl"}]},"directories":{}},"3.0.0":{"author":{"name":"M Gradek"},"name":"connect-redirecthost","description":"Connect middleware for the Express.js framework that allows redirecting multiple domains to a default one","version":"3.0.0","repository":{"url":"git+ssh://git@github.com/perropicante/connect-redirecthost.git"},"main":"index","engines":{"node":">= 8"},"dependencies":{"urijs":"1.19.1"},"devDependencies":{"vows":"latest"},"scripts":{"test":"vows test/*.js"},"gitHead":"212b9ffda68534f4644d3eed95c55958ccc29c00","bugs":{"url":"https://github.com/perropicante/connect-redirecthost/issues"},"homepage":"https://github.com/perropicante/connect-redirecthost#readme","_id":"connect-redirecthost@3.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.1","_npmUser":{"name":"cdnbacon","email":"mike@busbud.com"},"dist":{"integrity":"sha512-1FhftK2mr2xKOy1CLQzDPwC/TYVEXTUq7QqhKGeQUGDzrsjAoW8hyPG1keZjRCZj6EOrdN8RmN1ZQMQrde/HDQ==","shasum":"846544a64ef31dd1e8c8476cbe60bc1a47f973d1","tarball":"https://registry.npmjs.org/connect-redirecthost/-/connect-redirecthost-3.0.0.tgz","fileCount":7,"unpackedSize":20193,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyhmJfWIehrxwE4uL602YvgCGhG6u4C2C6iVa5k20kxAIhAIp6eGAVJMHQAYJg49QFcuIWRxy5Qunhk+12RJKjZr2X"}]},"maintainers":[{"name":"cdnbacon","email":"mike@busbud.com"},{"name":"perropicante","email":"perropicante@hotmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/connect-redirecthost_3.0.0_1522251783910_0.998148219029918"},"_hasShrinkwrap":false}},"readme":"# Connect Host Redirect\n\nconnect-redirecthost is middleware for the Express.js framework that allows redirecting multiple domains to a default one.\n\n[![Build Status](https://travis-ci.org/perropicante/connect-redirecthost.svg?branch=master)](https://travis-ci.org/perropicante/connect-redirecthost)\n\n## Installation\n\n    $ npm install connect-redirecthost\n\n## Quick Start\n\nUsing connect-redirecthost is easy. Register it within Express.js as middleware by adding the following line into your app.js file before most calls to app.use(...):\n\n```javascript\napp.use(require('connect-redirecthost').redirectHost('www.example.com'));\n```\n\nLocalhost is always excluded to make local development easier.\n\n### Exceptions\n\nRedirect exceptions are supported. If, for example, your site uses a CDN on a separate domain, you can create an exception for that domain\n\n```javascript\napp.use(require('connect-redirecthost').redirectHost({\n to: 'www.example.com',       // all requests not on www.example.com will be redirected to www.example.com\n except: 'cdn.example.com'    // except for those to cdn.example.com\n}));\n```\n\nYou can also specify multiple exceptions using an array.\n\n```javascript\napp.use(require('connect-redirecthost').redirectHost({\n to: 'www.example.com',\n except: ['cdn.example.com', 'origin.example.com']\n}));\n```\n\n### Path handling\n\nBy default, the root-relative path is preserved during the redirect. Should the root relative path need to be modified reset,\nthe following options can be used, where the path will be set to the associated domain's value\n\n```javascript\napp.use(require('connect-redirecthost').redirectHost({\n    to: 'www.example.com',\n    changePath: {'www.example.ca': '/ca', 'www.example.us': '/us'}\n}));\n```\n\nYou can also specify a function to determine the new path;\n\n```javascript\napp.use(require('connect-redirecthost').redirectHost({\n    to: 'www.example.com',\n    changePath: {\n     'www.example.ca': function(host, url){return '/ca' + url;},\n     'www.example.us': function(host, url){return '/us' + url;}\n    }\n}));\n```\n\n### Protocol overrides\n\nBy default, the current protocol is preserved when redirecting. Using the `protocol` option forces the redirect to a\nparticular protocol. Typical values are `http` and `https`.\n\n```javascript\napp.use(require('connect-redirecthost').redirectHost({\n    to: 'www.example.com',\n    protocol: 'https'\n}));\n```\n\nIMPORTANT! Keep in mind this only sets the protocol when redirecting based on host matches. This will not normalize\nthe protocol on all requests. You'll need another module to accomplish that.\n\n## License\n\nMIT License, see the LICENSE file.\n\n\n","maintainers":[{"name":"cdnbacon","email":"mike@busbud.com"},{"name":"perropicante","email":"perropicante@hotmail.com"}],"time":{"modified":"2022-06-13T21:41:36.377Z","created":"2011-12-09T04:26:48.054Z","0.0.0":"2011-12-09T04:26:48.290Z","0.0.1":"2011-12-09T06:08:12.982Z","0.0.2":"2011-12-09T06:30:45.210Z","0.0.3":"2012-02-08T06:36:04.516Z","0.0.4":"2012-06-13T05:55:58.806Z","1.0.0":"2014-07-03T20:04:06.468Z","2.0.0":"2014-11-09T00:52:59.147Z","3.0.0":"2018-03-28T15:43:03.957Z"},"author":{"name":"M Gradek"},"repository":{"url":"git+ssh://git@github.com/perropicante/connect-redirecthost.git"},"readmeFilename":"Readme.md","homepage":"https://github.com/perropicante/connect-redirecthost#readme","bugs":{"url":"https://github.com/perropicante/connect-redirecthost/issues"}}