Base URL with www / without www

Hi,
I use hugo and hermit as theme at this site:
https://beck24.be/

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 (volkerbeck.info and beck24.be) 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 all-inkl.com. 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? https://beck24.be or just / ?

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

As to all-inkl.com – 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: www.vlkr.be and vlkr.be both work and show the same page. Whereas www.beck24.be and beck24.be 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 (.*) [https://beck24.be](https://beck24.be/)%{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.