# How to redirect my a request on (localhost:5601) to my custom developed plugin?

**URL:** https://discuss.elastic.co/t/how-to-redirect-my-a-request-on-localhost-5601-to-my-custom-developed-plugin/113763
**Category:** Kibana
**Created:** [January 2, 2018, 11:31am UTC](https://discuss.elastic.co/t/how-to-redirect-my-a-request-on-localhost-5601-to-my-custom-developed-plugin/113763 "2018-01-02T11:31:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sreenu](https://avatars.discourse-cdn.com/v4/letter/s/f04885/32.png) [@sreenu](https://discuss.elastic.co/u/sreenu)
#### Post date: [January 2, 2018, 11:31am UTC](https://discuss.elastic.co/t/how-to-redirect-my-a-request-on-localhost-5601-to-my-custom-developed-plugin/113763/1 "2018-01-02T11:31:27Z")

</div>

I want to redirect the user to custom HTML page before taking it to the kibana home page.  
The flow will be like a user will hit localhost:5601 and it should go to my custom homepage before going to the kibana homepage.

Thanks.

---

<div class="post-metadata">

### Author: ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)
#### Post date: [January 2, 2018, 5:59pm UTC](https://discuss.elastic.co/t/how-to-redirect-my-a-request-on-localhost-5601-to-my-custom-developed-plugin/113763/2 "2018-01-02T17:59:50Z")

</div>

If the page you're trying to direct users to is itself a Kibana plugin, you can intercept the request and redirect the user. You'll need to track state somehow, probably with a cookie, to control when a user does and does not get redirected to your plugin.

The `kibana` object in a Kibana plugin's configuration allows an `init` property, which gets a reference to the `server` object. See the [plugin template for an example](https://github.com/elastic/template-kibana-plugin/blob/master/template/index.js#L35-L38). That `server` object is just the raw [Hapijs server object](https://hapijs.com/api/14.2.0#server-properties). That object allows you to configure pre-route hooks that you can use to control the redirecting.

If you code is not actually a Kibana plugin, then I don't think this is possible.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [January 30, 2018, 6:00pm UTC](https://discuss.elastic.co/t/how-to-redirect-my-a-request-on-localhost-5601-to-my-custom-developed-plugin/113763/3 "2018-01-30T18:00:15Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
