Base URL with www / without www

I use hugo and hermit as theme at this site:

without www everything looks fine, with www not. How must I configure config to create a page, using both variables? with and without www ?

And, how could I configure the base URL, so that two URLs ( and point to the same website. Is that possible with hugo? or would I have to use a redirect from the .info to the .be?

Both of your questions’ answer live outside of Hugo – and the answer depends on where/how you host your site.

Ok. It is hosted in Germany by How should I set the domains up? forward to www to the without the www?

And how should the base URL in congif.yaml look like? or just / ?

If that is the URL of your site, then that is correct.

As to – I don’t know how to configure their DNS, you may have better success looking into their documentation or asking them.

Will do. Thx.

Weird thing, though: and both work and show the same page. Whereas and do not. Both same hoster, same root folder, same hugo system, same config.

I got this answer, in case someone has the same problem and is also hosting with all-inkl:

Create a htaccess ( .htaccess ) in your /public folder and include this in the htaccess:

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule (.*) []({REQUEST_URI} [L,NE,R=301]

Of course, for others, please change the TLD.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.