"invalid host in redirect target" - Can't find the error

My domain is: cartan.hopto.org

I ran this command:certbot certonly --webroot -w /usr/local/www/nexcloud -d cartan.hopto.org

It produced this output:

Invalid host in redirect target “cartan.hopto.org.well-known”.
Check webserver config for missing ‘/’ in redirect target.

My web server is (include version): NextCloud 18 on Apache2.4

The operating system my web server runs on is (include version): FreeNAS 11

I can login to a root shell on my machine (yes or no, or I don’t know): yes

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot): 1.1.0

Question: I understand the issue is with this redirect such that it sees “cartan.hopto.org.well-known” instead of “cartan.hopto.org/.well-known”, but I can’t find where this redirect is configured in ?? What/where do I need to change somehting (Apologies for a probably very basic question from a newbie) ?

I ran https://check-your-website.server-daten.de/?q=cartan.hopto.org and it confirms “redirect to not existing domain”

Thanks in advance for any help !

Probably in the Apache configuration file containing the HTTP VirtualHost section. Another posibility would be a .htaccess file in the document root of the virtualhost.

Hi @carrabta

see your check:

Domainname Http-Status redirect Sec. G
http://cartan.hopto.org/ 301 https://cartan.hopto.org Html is minified: 100,00 % 0.060 A

There is already the “missing /”. That’s not a problem because that works. But with a subfolder, it’s the “missing /”.

So your first redirect http -> https is wrong.

It’s not only the redirect http + /.well-known/acme-challenge -> https + /.well-known/acme-challenge.

1 Like

Excellent, guys - I think I found it !
So it was in the definition of the virtual host (attached screenshot).

in /usr/local/etc/apache24/Includes.
I have added the ‘/’ at the end of “https://cartan.hopto.org**/**” under the virtual host *.80.

I could update the certificate, that worked. I’m still struggling with access though, but probably another cause, as you seem to point out, Juergen. Although it was working fine before, so not sure where to look, now…

Thanks again.

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