1
app.website.local을 내 로컬 호스트 127.0.0.1에 매핑하도록 etc/hosts를 수정했습니다. 이것은 작동하고 내 localhost로 리디렉션됩니다.레일 하위 도메인이 작동하지 않습니다.
문제는 request.subdomain
이 비어있어서 아무 것도 할 수 없다는 것입니다.
class ApplicationController
before_filter :ensure_domain
private
def ensure_domain
# do something with the request
# here is request.subdomain empty
end
end
내 등/호스트 :
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
127.0.0.1 app.website.local