Outlast Apps - Microsites, custom domains


Set up a custom domain in Apache

If you have properly prepared your Outlast Apps plugin (see below), then setting up a custom domain is rather easy.

You need to set up your Apache virtual server config as any other. To enable automatic routing to a specific app based on the current virtual server you need to set the id of the app with the OUTLAST_APPS_APPID Apache environmental variable:

SetEnv OUTLAST_APPS_APPID "your app id"

You can also set a custom start page for your domain using OUTLAST_APPS_STARTPAGE:

SetEnv OUTLAST_APPS_STARTPAGE "your_start_page"

This will direct users to the your_start_page method in your custom controller.

So an example of a fully working virtual server would be as follows:

<VirtualHost *:80>
   ServerName example.com
   ServerAdmin support@example.com
   
   DocumentRoot /var/www/app.outlast.hu/
   <Directory /var/www/app.outlast.hu>
		# ..Directory options go here...
		Allow from all
		AllowOverride All		
   </Directory>

   # Set up Outlast Apps by domain
   SetEnv OUTLAST_APPS_APPID "535f5cd119c77"
   SetEnv OUTLAST_APPS_STARTPAGE "coming_soon"

   # Other settings...
</VirtualHost>

Prepare Outlast Apps

If you haven’t enabled this feature in your copy of Outlast Apps, you need to perform the following steps first.

Open up your default.ctl.php and add this to your main() method:

public function main(){
	// Start with domain
		$this->zajlib->outlastapp->start_with_domain();
}

If you have the wordpress plugin enabled, make sure your front page is set so that main() actually runs. You can do this by using register_templatesee docs.

If you want to enable friendly urls, add the following code to your __error() method:

public function __error(){
	// Start with domain
		$this->zajlib->outlastapp->start_with_domain();
}

Don’t worry, the start_with_domain() method will do nothing if the request is not coming through a properly enabled virtual server in Apache (see above).

Outlast Web & Mobile Development (c) 2019 | Privacy Policy |