rebrandly / rebrandly-express

Seamlessly connect your web server to Rebrandly so that you can re-use your domain name for both your app and your short links
https://rebrandly.com
GNU General Public License v3.0
3 stars 0 forks source link

Re-route all traffic to alias domain name through URL rewriting #5

Closed giannifiore closed 2 years ago

giannifiore commented 2 years ago

Refer to https://github.com/rebrandly/rebrandly-express/wiki/URL-rewriting-and-alias-domains

User Stories

As a Rebrandly developer, I need the middleware to accept an alias domain name as input during its setup,
So that I can assume the alias domain name is always known at runtime

As a Rebrandly developer, I need the middleware to re-write the incoming HTTP request following a set of rewriting rules, So that I can make sure there is a testable module specific to URL rewriting

Acceptance Tests

Given a server running on domain acme.com Given that acme.com was added as an alias domain in Rebrandly Given that the alias of acme.com is xyzxyzxyz.rebrandly.cc

Given that there is no matching route for /promo When the server running at acme.com processes https://acme.com/promo URL Then the response is a 302 Temporary Redirect to URL https://xyzxyzxyz.rebrandly.cc/promo When the server running at acme.com processes http://acme.com/promo URL Then the response is a 302 Temporary Redirect to URL https://xyzxyzxyz.rebrandly.cc/promo When the server running at acme.com processes https://acme.com/promo?super=true URL Then the response is a 302 Temporary Redirect to URL https://xyzxyzxyz.rebrandly.cc/promo?super=true

giannifiore commented 2 years ago

working on it on branch url-rewriting

giannifiore commented 2 years ago

removed requirement of preserving "#querystring", because this value wouldn't reach server side