Skip to content

silgy_set_host_res

Jurek Muszyński edited this page Nov 18, 2019 · 4 revisions

bool silgy_set_host_res(const char *host, const char *res, const char *resmin)

Description

Assigns res and resmin directories to a host. If requested host matches one of those set with silgy_set_host_res, the engine will use these alternative resources instead of those from res and resmin.

Host comparison is case-insensitive and port number is cuf off if present in request.

Directories specified in res and resmin need to be under SILGYDIR. For the security reasons it's not possible to set absolute path here.

Returns

true if OK, false if MAX_HOSTS has been reached.

Example

// in silgy_app_init()
// Host additional domains on example.com's server:
silgy_set_host_res("example1.com", "example1/res", "example1/resmin");
silgy_set_host_res("example2.com", "example2/res", "example2/resmin");
Clone this wiki locally