How to redirect a missed subdomain

I'm on abc.domainname.com

Now in any action

I want to redirect to a page domainname.comwithout a subdomain.

How can i do this?

I tried how index_path(:subdomain => false).

If I am hardcode like redirect_to("http://domainname.com"). Then it works.

+3
source share
1 answer

I did so

index_url(:subdomain => false)

And it works!

+8
source

Source: https://habr.com/ru/post/1789663/


All Articles