Custom URLs for each event

Hi folks,

we started using indico for our community last autumn and as the number of events is rising we were wondering, if anyone has experience in setting up indico to use custom URLs for each event.

Idea scetch: Instead of example .com/e/conference2018 which forwards to example .com/events/1/ we register a new subdomain and get beautiful URLs such as conference2018

I worked with vhosts in apache before, but just for PHP-based pages. I’m really not sure how (and especially if) this could be set up.

Do you have ideas how to accomplish this? Is anyone else interested in this feature?

System: Indico 2.0.3, Apache2, postgreSQL

1 Like

If you just need a redirect it’s easy with rewrite rules.

If you want to keep the “pretty” URL in your address bar, that won’t work without some changes to Indico itself.

URL forwarding is for sure an option, but pretty URL would actually be great. I’m thinking about trying to develop something for this, but I can not overview how much work this would need.

What do you think:
1.) Is this a feature also others would like to have?
2.) How many hours of development should I expect?
3.) Do you think we could try using proxypass to get what is needed?

I don’t think it can rewrite URLs e.g. in the HTML output and in redirects. Anyway, haven’t used Apache much lately, so can’t say for sure.

Not sure… the typical use case of meetings and a few conferences probably needs it less than people using it for just a few bigger conferences. I’m pretty sure some people would use it if available.

That depends on how familiar you are with both Flask and the Indico codebase… hard to say.
I see two ways of implementing such a feature:

  • Doing it properly in Indico, i.e. with a setting on each event, and then with code that rewrites the URLs generated by url_for (adding the subdomain and removing the /event/<id> prefix) and - this is the tricky part - making the URL resolution logic of Flask/werkzeug look up the subdomain and convert to an event ID that is then used in the normal matching usually done in the /event/<id> part.

  • Doing it the dirty way using a WSGI middleware. Check if a request has a Host header with an event’s subdomain, map it to an event ID, and rewrite the URL so it appears to be /event/<id>/... for Flask and the rest of Indico. Same for the response, just the other way round: Any redirect or HTML page containing /event/<id> would be changed to use the subdomain instead.

If you want to give it a go, I would go for the second option. That’s something you could actually develop outside Indico (using a very small Flask app to test with) and then just use a custom WSGI file containing something like this (instead of the default one):

from import make_app
application.wsgi_app = MyFancyMiddleware(application.wsgi_app)
application = make_app()