How to make redirect from back-end side?


#1

I have an Ember js application, and back-end on Tornado The url format is like this: example.com/index.html#/some-page example.com/index.html#/other-page

Is there some way to make redirect from some-page to other-page from back-end side? When I’m making redirect to other-page l, browser is trunking the part of url, after # symbol, so I’m redirected to: example.com/index.html


#2

Servers don’t actually see anything past the first #. So no, that’s not going to work.

You have two choices:

  1. If you switch your Ember app from using hash location to history location, your app will use real URLs and then the server can see them and do redirects. See https://guides.emberjs.com/release/configuring-ember/specifying-url-type/
  2. You can do the redirects in the ember app instead. See https://guides.emberjs.com/release/routing/redirection/