redbird icon indicating copy to clipboard operation
redbird copied to clipboard

how to redirect to www. ?

Open Matthias-Hermsdorf opened this issue 7 years ago • 5 comments
trafficstars

Hi,

I'm using redbird for a while and it is realy nice. One question is open. What is the common way to redirect users from domain.tld to www.domain.tld or from marketingname.tld to domain.tld/somewhat

I could register both routes to the same destination and make the redirects in the destination http server. But this isn't the good wiring. How do you solve this task at your projects?

Matthias-Hermsdorf avatar Apr 03 '18 21:04 Matthias-Hermsdorf

I'm having the same issue, but looking at the code there is no way to do this atm.. :(

But it wouldn't be too hard to implement, in a way it would be a variation on the shouldRedirectToHttps function. A simple option like httpRedirect = true; as an option to the redbird.register would be great, this would then do a simple 302 redirect instead of proxy.

Or alternatively make it so the req / res could be intercepted like a middleware.

I could implement this, but would be much better if a maintainer could do this.

KpjComp avatar Apr 11 '18 12:04 KpjComp

The req / res would be nice for some tasks.

For the redirect I think about a redbird.redirect(from, to, responsecode: 302)

Matthias-Hermsdorf avatar Apr 12 '18 08:04 Matthias-Hermsdorf

+1 Would love to have this feature!

yzgyyang avatar Nov 19 '18 22:11 yzgyyang

+1 waiting for this feature

adhisimon avatar Jan 21 '19 08:01 adhisimon

+1 waiting for this feature

UltraCakeBakery avatar Jun 15 '19 09:06 UltraCakeBakery