Skip to content

MS RFC 141: Add MS_ONLINERESOURCE to CONFIG file - #7434

Merged
rouault merged 7 commits into
MapServer:mainfrom
geographika:config-onlineresource
Feb 23, 2026
Merged

rouault merged 7 commits into
MapServer:mainfrom
geographika:config-onlineresource

Conversation

@geographika

@geographika geographika commented Feb 13, 2026 •

Copy link
Copy Markdown
Member

Implementation of RFC 141.

Adds a new MS_ONLINERESOURCE to the MapServer CONFIG file.

  CONFIG
    ENV
      MS_ONLINERESOURCE "https://maps.example.com/"
    END
    MAPS
      EXAMPLE "/data/mapfiles/example.map"
    END
  END

When accessing the Mapfile using its key (EXAMPLE in the above example), a request such as https://maps.example.com/example/?service=wms&version=1.3.0&request=GetCapabilities will return a GetCapabilities response with the base URL set to https://maps.example.com/.

    <WMS_Capabilities>
    <Service>
    <Name>WMS</Name>
    <Title>Example</Title>
    <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://maps.example.com/example/?"/>

When accessing a Mapfile using the &map= parameter, this will be appended to the MS_ONLINERESOURCE URL. For example, a request to https://maps.example.com/?map=/data/mapfiles/example.map&service=wms&version=1.3.0&request=GetCapabilities will return a GetCapabilities response including the following:

    <HTTP>
    <Get>
    <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://maps.example.com/?map=/data/mapfiles/example.map&"/>
    </Get>

For OGC API URLs requests such as https://maps.example.com/example/ogcapi/?f=json will return URLs in the format https://maps.example.com/example/ogcapi/collections?f=html.

@rouault

rouault commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

to be rebased on top of latest main to fix conflicts

@geographika
geographika force-pushed the config-onlineresource branch from 2b6f4fa to e376fcd Compare February 17, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants