# How to allow multiple hostnames to login?

**URL:** <https://meta.discourse.org/t/how-to-allow-multiple-hostnames-to-login/128632>\
**Category:** Product Support\
**Created:** [9월 15, 2019, 4:11오후 UTC](https://meta.discourse.org/t/how-to-allow-multiple-hostnames-to-login/128632 "2019-09-15T16:11:09Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)\
**Post date:** [9월 16, 2019, 6:33오전 UTC](https://meta.discourse.org/t/how-to-allow-multiple-hostnames-to-login/128632/3 "2019-09-16T06:33:42Z")

</div>

You will need to disable this function [discourse/lib/middleware/enforce\_hostname.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/lib/middleware/enforce_hostname.rb)

Plugin code would be

```
after_initialize do

  module ::OverrideEnforceHostname
    def call(env)
      @app.call(env)
    end
  end

  class Middleware::EnforceHostname
    prepend OverrideEnforceHostname
  end

end

```

---

_[View the full topic](https://meta.discourse.org/t/how-to-allow-multiple-hostnames-to-login/128632)._
