Opened 3 years ago

Last modified 2 years ago

#5504 new enhancement

Support alternate URL prefixes

Reported by: Vaelatern Owned by:
Priority: minor Milestone:
Component: programming Keywords:
Cc: Parent Tickets:

Description

In the scenario where the user (me) wants to run Mediagoblin under, for example, example.com/mg/, mediagoblin makes this very difficult.

I was able to route /mgoblin_static to /mg/mgoblin_static, and was able to serve the main page under /mg, but was unable to use the site as other actions (like submitting new media) brought me back to / rooted URLs.

Official support for prefixes would be quite nice for people who want to have small setups, or don't want to have a subdomain for this program.

Subtickets

Change History (1)

comment:1 Changed 2 years ago by ayleph

I run a MediaGoblin instance under /mediagoblin with no problems, and I didn't have to modify any MediaGoblin code to do so. This may be an issue with your webserver configuration rather than an issue with MediaGoblin itself. Here's the relevant section of my lighttpd config file, for reference.

$HTTP["host"] == "example-mediagoblin-site.com" {
  server.document-root = "/srv/http/vhosts/example-mediagoblin-site.com/htdocs/"

  alias.url += (
    "/mgoblin_static" => "/srv/mediagoblin/mediagoblin/mediagoblin/static/",
    "/mgoblin_media/" => "/srv/mediagoblin/mediagoblin/user_dev/media/public/",
    "/theme_static/" => "/srv/mediagoblin/mediagoblin/user_dev/theme_static/",
    "/plugin_static/" => "/srv/mediagoblin/mediagoblin/user_dev/plugin_static/"
  )

  $HTTP["url"] =~ "^/mediagoblin/" {
    fastcgi.server = ( "/mediagoblin" =>
      ( "localhost" =>
        ( "host" => "127.0.0.1",
          "port" => 26543,
          "docroot" => "/srv/mediagoblin/mediagoblin/mediagoblin",
          "check-local" => "disable",
          "max-procs" => 1,
          "fix-root-scriptname" => "enable"
        )
      )
    )
  }
}
Note: See TracTickets for help on using tickets.