Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ability to redirect user from subdomain to some predefined url. #3

Merged
merged 6 commits into from
Apr 18, 2014

Conversation

matejvelikonja
Copy link
Contributor

No description provided.

array('subdomain.example.com'),
array('multi.subdomain.example.com'),
array('v.e.r.y.m.u.l.t.i.s.u.b.d.o.m.a.i.n.example.com'),
array('subdomain.example-is.com'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests fail if I add 'localhost' to this list.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I think example.co.uk won't work also. I have to rethink a bit. It's not that easy to know if domain contains subdomain. One possible solution would be, that you would need to specify used domain in config. Than it's quite easy. What you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I was thinking something similar as well. I think it'd be best to have a list of patterns to match against the host and then only redirect matching hosts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe for starters we could just use this parameter router.request_context.host to know which is the main domain.

matejvelikonja added a commit that referenced this pull request Apr 18, 2014
Added ability to redirect user from subdomain to some predefined url.
@matejvelikonja matejvelikonja merged commit 6b4a8b6 into master Apr 18, 2014
@matejvelikonja matejvelikonja deleted the subdomain-listener branch April 18, 2014 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants