menu

SiteGenesis / Server-side JS / Module: controllers/RedirectURL

Controller that handles URL redirects.

It is called by the system to handle URL mappings (static mappings and mapping rules). The mappings are configured in Business Manager. This controller is highly performance critical, because it is frequently called in case of exploit scans.

Please follow these rules:

  • no or only a few database calls
  • simple (static) template response
  • caching the result page is a must
Source:

Members

(static) Hostname

Used by the platform for URL redirects.

Source:
See:

(static) Start

Gets a redirect and renders it.

Source:
See:

Methods

(inner) hostName()

Hostname-only URLs (http://sitegenesis.com/) cannot be redirected using the URL mapping framework. Instead, specify this controller in your site's hostname alias in Business Manager.

However, a redirect to the homepage is performed by the Default controller Start function. The hostname in the URL is the site's HTTP Hostname, if one is configured in Business Manager. Also, you can provide a URL to redirect to an optional parameter, Location.

Source:
Example
Redirect http[s]://sitegenesis.com/ to http://www.sitegenesis.com/:
sitegenesis.com,,RedirectURL-Hostname,Location,http://www.sitegenesis.com/

(inner) start()

Gets the redirect. Renders the template for a redirect (util/redirectpermanent template). If no redirect can be found, renders an error page (util/redirecterrorutil/redirecterror template).

Source: