Hugo

Deployment preparation

Hello guys,
my website is more or less OK on the localhost:1313 and I decided to test-deploy it on my local apache webserver as localhost/hugo.

After a lot of attempts I got it to render the index page with the setting

baseURL = ""

However at the moment it does not open other pages without .html extensions.

In my config.toml they are named without .html extension - but they worked fine on localhost:1313.
My questions are:

  1. Is it better to tune webserver to open pages without .html or add .html to page names in config.toml?
  2. How to tweak webserver to render files without .html extension?
  3. How to set my config.toml for apache localhost?
  4. How to set my config.toml for (apache) testcase.mydomain.com?
  5. How to set my config.toml for www.mydomain.com? (hugo with baseURL=“mydomain.com”? )
    Thanks in advance!

My suggestion is to not do that. Use the development server (hugo server), or deploy to an Apache server with a domain mapped to it and is configured to serve already.

Your questions are about the Hugo config options, but we don’t know what your Apache config is like, and you’ll have better luck going to an Apache support place and asking how to set it up to serve your static site. Your base URL should be set to the address Apache is serving. :slight_smile:

1 Like

Thank you for the info! My local apache config is the one that I configure. I can enable/disable anything.
I can upload to the remote webserver - but what if the website does not show pictures or does not load pages there? I want development server - test server - deployment server scenario.