You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Status

Proposal needs feedback

Target Release

4.1

Original Authors

Dave Johnson and Sean Gilligan

Abstract

This is a proposal to enable subdomain and/or multi-domain support in Roller. It is based on Dave's work in Proposal Simple Multidomain Support but provides for explicit support for subdomains and stores custom URLs for weblogs in the weblog table rather than in roller-custom.properties.

Requirements

  • Allow Roller to use blog handles as subomains (e.g. http://handle.baseurl.com)
  • Allow one Roller instance to specify different URLs for different weblogs, stored in the database
  • Ensure that each weblog is only accessed by one root URL

Issues

  • Is this design flexible enough to meet most of the requests we've seen so far?
  • How to avoid a repeat of "handle" in the pathInfo of the URL (e.g. http://handle.baseurl.com/handle)
  • Requires adding URL column to weblog table
  • How much refactoring is required to achieve DRY in the URL resolution code?

Design

Changes to Weblog POJO

Weblog.getAbsoluteURL() uses URLStrategy to return URLs

    public String getAbsoluteURL() {
    	URLStrategy urlStrategy = WebloggerFactory.getWeblogger().getUrlStrategy();
    	return urlStrategy.getWeblogURL(this, null, true);
    }

Weblog.getURL() calls Weblog.getAbsoluteURL()

If we are going to use subdomain URLs, we'll need to always (question) use absolute URLs when referring to Weblogs (at the very least we need to change some assumptions)

    public String getURL() {
         return getAbsoluteURL();
     }

Changes to URLModel

URLModel.getAbsoluteSite() uses URLStrategy

    /** Absolute URL of Roller, e.g. http://localhost:8080/roller */
    public String getAbsoluteSite() {
  //      return WebloggerRuntimeConfig.getAbsoluteContextURL();
    	URLStrategy urlStrategy = WebloggerFactory.getWeblogger().getUrlStrategy();
    	return urlStrategy.getWeblogURL(weblog, null, true);
   }

Configuration

Server Administrator

Roller deployment is configured by the server administrator with the following settings:

Blog Administrator

Blog administrator can enable a custom domain on a per-webblog basis (if enabled by the server admin)

  • Requires an additional setting on the Weblog Settings UI screen (hidden when disabled)
  • Custom domains on Weblogs might require the subdomain URL strategy (question)

Comments

Please comment on the Roller dev mailing list.

  • No labels