Set default map

13 views
Skip to first unread message

Chris Ward

unread,
Sep 15, 2018, 4:44:45 AM9/15/18
to opentreemap-user
Hi Everyone,

Is there a way to set the default map that is displayed when going to the base URL? Currently, when going to the index page, it shows "explore trees" in the top nav-bar, but the bottom, under the OTM logo, is blank. My instance of OTM will only include one map, and I would like for this map to be shown automatically when a user visits the site. Any help is greatly appreciated.

Regards,

Chris

Justin Walgran

unread,
Sep 19, 2018, 10:51:38 AM9/19/18
to opentree...@googlegroups.com
One simple way to get the behavior you are looking for is to add a redirect to your nginx configuration. Below is an example from my development environment. The bold block is the statement I added to redirect the root url to the map page. You would need to replace "philly" with your map name.

location /static/ {
  alias /usr/local/otm/static/;
}

location /media/ {
alias /usr/local/otm/media/;
}

location = / {
  return 302 $scheme://$http_host/philly/map/;
}

location / {
  proxy_set_header Host $http_host;
  proxy_redirect off;

  if (!-f $request_filename) {
    proxy_pass http://app;
    break;
  }
}

--
You received this message because you are subscribed to the Google Groups "opentreemap-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentreemap-us...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Ward

unread,
Sep 19, 2018, 11:23:29 AM9/19/18
to opentree...@googlegroups.com
Awesome, thanks! I was trying to play with rewrites in the django urls file, but that wasn't getting me far at all. Completely forgot about the nginx router.
Reply all
Reply to author
Forward
0 new messages