Docs
Advanced Features

Advanced Features

In this section we’ll discuss how you can setup custom domains, SSL support for your domain, customize 404 pages on Staticrun.

Custom Domains

Learn how to add a custom domain to your Staticrun project, verify it, and correctly set the DNS records.

Staticrun provides all deployments with a staticrun.app URL, which enables you to share deployments with the world. However, to provide greater personalization and flexibility to your project, you can instead add a custom domain. If you don't own a domain yet, you can purchase it from a domain registrar(e.g. GoDaddy, Namecheap, Google Domains).

The following steps provide an overview of how to add and configure a custom domain in Staticrun:

  1. Navigate to Domain Settings On the My Project (opens in a new tab) page, pick the project to which you would like to assign your domain.

Click on the settings icon of that project, and you’ll be redirected to the project settings page.

domain setting

Click on Domains to navigate to the domain settings page and you’ll see an option to connect your custom domain at the bottom.

domain setting

  1. Add your domain From the Custom Domains section, enter the domain you wish to add to the project:

domain setting

  1. Configure your domain Once you have added your custom domain, you will need to configure the DNS records of your domain with your registrar so it can be used with your Project. The dashboard will automatically display a guide methods for configuring it:

domain setting

SSL Support

By default, Staticrun automatically provides all domains with an SSL encryption for free.

404 page handling

By default, a 404.html file will be created in your project to serve as the not-found page. You can customize the 404 page by simply adding a 404.html file in your project. When Staticrun detects this file in the project it’ll automatically replace and use your version of the file.

project setting

Setting Homepage

By default Staticrun will use the index.html as the homepage(the page at / path) for the site. But this behavior can be changed. You can set a different file(e.g. dashboard.html) as your sites homepage.

When someone navigates to your site https://hello-world.staticrun.app/ the page which is marked as homepage will be served for that path.

Let’s see how you can mark a file in your project as homepage:

  1. Go to My Projects page. Select the project and click on the settings icon.

project settings

  1. Now click on All Pages and you’ll see all the pages in your project.

project settings

The home icon near index.html indicates that this file is currently being served as the homepage.

  1. Go to settings of the page and set as homepage. Click on the settings icon of the page you want to mark as homepage. project settings

Make sure the page visibility is public; click on the Set as Homepage checkbox and then Save Homepage. Your changes will take effect few moments after that, can take around 3-5 minutes depending on the page size.

project settings

Note: Pages with visibility set to Private can’t be set as homepage.

Now if you visit the homepage of your site, you’ll see index.html is no longer being served as the homepage rather the page you have set is being served as the homepage.