# Failed redirect

**URL:** <https://community.letsencrypt.org/t/failed-redirect/163099>\
**Category:** Help\
**Created:** [October 14, 2021, 1:18pm UTC](https://community.letsencrypt.org/t/failed-redirect/163099 "2021-10-14T13:18:49Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthewcole805](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@matthewcole805](https://community.letsencrypt.org/u/matthewcole805)\
**Post date:** [October 14, 2021, 1:18pm UTC](https://community.letsencrypt.org/t/failed-redirect/163099/1 "2021-10-14T13:18:49Z")

</div>

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. [crt.sh | example.com](https://crt.sh/?q=example.com)), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: [matthewalbertcole.com](http://matthewalbertcole.com)

I ran this command: certbot -d [matthewalbertcole.com](http://matthewalbertcole.com)

It produced this output:

```nohighlight
Deploying certificate
Successfully deployed certificate for matthewalbertcole.com to /etc/apache2/sites-enabled/matthewalbertcole.com-le-ssl.conf
Failed redirect for matthewalbertcole.com
Unable to set the redirect enhancement for matthewalbertcole.com.

NEXT STEPS:
- The certificate was saved, but could not be installed (installer: apache). After fixing the error shown below, try installing it again by running:
  certbot install --cert-name matthewalbertcole.com-0001

Unable to find corresponding HTTP vhost; Unable to create one as intended addresses conflict; Current configuration does not support automated redirection

```

My web server is (include version): ubuntu

The operating system my web server runs on is (include version): ubuntu 20.04

My hosting provider, if applicable, is: [digitalocean.com](http://digitalocean.com)

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

I'm using a control panel to manage my site (no, or provide the name and version of the control panel): pm2 apache2

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

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [October 14, 2021, 3:32pm UTC](https://community.letsencrypt.org/t/failed-redirect/163099/2 "2021-10-14T15:32:17Z")

</div>

Please review (and fix) your `Apache` configuration.  
Start with the output of:  
`sudo apachectl -t -D DUMP_VHOSTS`

---

<div class="post-metadata">

**Author:** ![matthewcole805](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@matthewcole805](https://community.letsencrypt.org/u/matthewcole805)\
**Post date:** [October 14, 2021, 10:22pm UTC](https://community.letsencrypt.org/t/failed-redirect/163099/3 "2021-10-14T22:22:41Z")

</div>

Ok, thank you for the reply. Here is the output of `sudo apachectl -t -D DUMP_VHOSTS`

```nohighlight
VirtualHost configuration:
*:443 is a NameVirtualHost
         default server www.matthewalbertcole.com (/etc/apache2/sites-enabled/matthewalbertcole.com-le-ssl.conf:2)
         port 443 namevhost www.matthewalbertcole.com (/etc/apache2/sites-enabled/matthewalbertcole.com-le-ssl.conf:2)
         port 443 namevhost matthewalbertcole.com (/etc/apache2/sites-enabled/matthewalbertcole.com-le-ssl.conf:12)
         port 443 namevhost www.pdxwater.org (/etc/apache2/sites-enabled/pdxwater.org-le-ssl.conf:2)
         port 443 namevhost pdxwater.org (/etc/apache2/sites-enabled/pdxwater.org-le-ssl.conf:12)

```

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [October 15, 2021, 12:04am UTC](https://community.letsencrypt.org/t/failed-redirect/163099/4 "2021-10-15T00:04:26Z")

</div>

Is that all of it?

Where are the entries for HTTP?:

```nohighlight
*:80 is a NameVirtualHost
        default server .....
        port 80 namevhost .....
        port 80 namevhost .....

```

---

<div class="post-metadata">

**Author:** ![matthewcole805](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@matthewcole805](https://community.letsencrypt.org/u/matthewcole805)\
**Post date:** [October 15, 2021, 12:44am UTC](https://community.letsencrypt.org/t/failed-redirect/163099/6 "2021-10-15T00:44:21Z")

</div>

oops, sorry here is the rest:

```nohighlight
VirtualHost configuration:
*:443 is a NameVirtualHost
         default server www.matthewalbertcole.com (/etc/apache2/sites-enabled/matthewalbertcole.com-le-ssl.conf:2)
         port 443 namevhost www.matthewalbertcole.com (/etc/apache2/sites-enabled/matthewalbertcole.com-le-ssl.conf:2)
         port 443 namevhost matthewalbertcole.com (/etc/apache2/sites-enabled/matthewalbertcole.com-le-ssl.conf:12)
         port 443 namevhost www.pdxwater.org (/etc/apache2/sites-enabled/pdxwater.org-le-ssl.conf:2)
         port 443 namevhost pdxwater.org (/etc/apache2/sites-enabled/pdxwater.org-le-ssl.conf:12)
*:80 is a NameVirtualHost
         default server matthewalbertcole.com (/etc/apache2/sites-enabled/matthewalbertcole.conf:1)
         port 80 namevhost matthewalbertcole.com (/etc/apache2/sites-enabled/matthewalbertcole.conf:1)
                 alias www.matthewalbertcole.com
         port 80 namevhost pdxwater.org (/etc/apache2/sites-enabled/pdxwater.org.conf:1)
                 alias www.pdxwater.org

```

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [October 15, 2021, 2:43am UTC](https://community.letsencrypt.org/t/failed-redirect/163099/7 "2021-10-15T02:43:13Z")

</div>

Let's have a look at this file:

> [@matthewcole805](#):
>
> `/etc/apache2/sites-enabled/matthewalbertcole.conf`

---

<div class="post-metadata">

**Author:** ![matthewcole805](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@matthewcole805](https://community.letsencrypt.org/u/matthewcole805)\
**Post date:** [October 15, 2021, 3:12am UTC](https://community.letsencrypt.org/t/failed-redirect/163099/8 "2021-10-15T03:12:25Z")

</div>

I was messing around and realized I accidentally misnamed it matthewalbertcole.conf instead of matthewalbertcole.com.conf, so I corrected it and re-enabled it. The problem persisted though. Here is the contents:

```nohighlight
<VirtualHost *:80>

        ServerAdmin root@matthewalbertcole.com
        DocumentRoot /var/www/matthewalbertcole.com/
        ServerName matthewalbertcole.com
        ServerAlias www.matthewalbertcole.com

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        #Redirect permanent / https://matthewalbertcole.com

        #ProxyRequests On
        #ProxyPass / https://localhost:8080/
        #ProxyPassReverse / localhost:8080/

</VirtualHost>

```

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [October 15, 2021, 3:19am UTC](https://community.letsencrypt.org/t/failed-redirect/163099/9 "2021-10-15T03:19:08Z")

</div>

> [@matthewcole805](#):
>
> `DocumentRoot /var/www/matthewalbertcole.com/`

Let's test that as the challenge path:

```nohighlight
sudo mkdir -p /var/www/matthewalbertcole.com/.well-known/acme-challenge/
echo X > /var/www/matthewalbertcole.com/.well-known/acme-challenge/Test-File-1234

```

Then we try to access is via:  
`http://matthewalbertcole.com/.well-known/acme-challenge/Test-File-1234`

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [October 15, 2021, 3:22am UTC](https://community.letsencrypt.org/t/failed-redirect/163099/10 "2021-10-15T03:22:12Z")

</div>

You can also replace this logic:  
[instead of ever reenabling it]

> [@matthewcole805](#):
>
> `#Redirect permanent / https://matthewalbertcole.com`

With this logic:

```nohighlight
  RewriteEngine On
  RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge [NC]
  RewriteCond %{HTTPS} !=on
  RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

```

---

<div class="post-metadata">

**Author:** ![matthewcole805](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@matthewcole805](https://community.letsencrypt.org/u/matthewcole805)\
**Post date:** [October 15, 2021, 3:55am UTC](https://community.letsencrypt.org/t/failed-redirect/163099/11 "2021-10-15T03:55:52Z")

</div>

> [@rg305](#):
>
> `http://matthewalbertcole.com/.well-known/acme-challenge/Test-File-1234`

# Not Found

The requested URL was not found on this server.

Apache/2.4.41 (Ubuntu) Server at [matthewalbertcole.com](http://matthewalbertcole.com) Port 80

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [October 15, 2021, 3:58am UTC](https://community.letsencrypt.org/t/failed-redirect/163099/12 "2021-10-15T03:58:00Z")

</div>

Show:  
`ls -l /var/www/matthewalbertcole.com/.well-known/acme-challenge/`

And again:  
`sudo apachectl -t -D DUMP_VHOSTS`

---

<div class="post-metadata">

**Author:** ![matthewcole805](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@matthewcole805](https://community.letsencrypt.org/u/matthewcole805)\
**Post date:** [October 15, 2021, 4:04am UTC](https://community.letsencrypt.org/t/failed-redirect/163099/13 "2021-10-15T04:04:13Z")

</div>

> [@rg305](#):
>
> ```nohighlight
> RewriteEngine On
> RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge [NC]
> RewriteCond %{HTTPS} !=on
> RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
> 
> ```

ok done as well

---

<div class="post-metadata">

**Author:** ![matthewcole805](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@matthewcole805](https://community.letsencrypt.org/u/matthewcole805)\
**Post date:** [October 15, 2021, 4:07am UTC](https://community.letsencrypt.org/t/failed-redirect/163099/14 "2021-10-15T04:07:15Z")

</div>

`ls -l /var/www/matthewalbertcole.com/.well-known/acme-challenge/`

```nohighlight
total 4
-rw-r--r-- 1 root root 2 Oct 15 03:53 Test-File

```

and `sudo apachectl -t -D DUMP_VHOSTS`

```nohighlight
*:443 is a NameVirtualHost
         default server www.matthewalbertcole.com (/etc/apache2/sites-enabled/matthewalbertcole.com-le-ssl.conf:2)
         port 443 namevhost www.matthewalbertcole.com (/etc/apache2/sites-enabled/matthewalbertcole.com-le-ssl.conf:2)
         port 443 namevhost matthewalbertcole.com (/etc/apache2/sites-enabled/matthewalbertcole.com-le-ssl.conf:12)
         port 443 namevhost www.pdxwater.org (/etc/apache2/sites-enabled/pdxwater.org-le-ssl.conf:2)
         port 443 namevhost pdxwater.org (/etc/apache2/sites-enabled/pdxwater.org-le-ssl.conf:12)
*:80 is a NameVirtualHost
         default server matthewalbertcole.com (/etc/apache2/sites-enabled/matthewalbertcole.com.conf:1)
         port 80 namevhost matthewalbertcole.com (/etc/apache2/sites-enabled/matthewalbertcole.com.conf:1)
                 alias www.matthewalbertcole.com
         port 80 namevhost pdxwater.org (/etc/apache2/sites-enabled/pdxwater.org.conf:1)
                 alias www.pdxwater.org

```

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [October 15, 2021, 4:12am UTC](https://community.letsencrypt.org/t/failed-redirect/163099/15 "2021-10-15T04:12:05Z")

</div>

Maybe you missed my last post/requests:

> [@rg305](#):
>
> Show:  
> `ls -l /var/www/matthewalbertcole.com/.well-known/acme-challenge/`
> 
> And again:  
> `sudo apachectl -t -D DUMP_VHOSTS`

---

<div class="post-metadata">

**Author:** ![matthewcole805](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@matthewcole805](https://community.letsencrypt.org/u/matthewcole805)\
**Post date:** [October 15, 2021, 4:21am UTC](https://community.letsencrypt.org/t/failed-redirect/163099/17 "2021-10-15T04:21:12Z")

</div>

my reply is still hidden...

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [October 15, 2021, 4:25am UTC](https://community.letsencrypt.org/t/failed-redirect/163099/18 "2021-10-15T04:25:22Z")

</div>

What do you mean hidden?  
I see nothing (even hidden)  
Just cancel it and do it again.  
Refresh the page if you have to.

---

<div class="post-metadata">

**Author:** ![matthewcole805](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@matthewcole805](https://community.letsencrypt.org/u/matthewcole805)\
**Post date:** [October 15, 2021, 4:28am UTC](https://community.letsencrypt.org/t/failed-redirect/163099/19 "2021-10-15T04:28:34Z")

</div>

> [@rg305](#):
>
> `sudo apachectl -t -D DUMP_VHOSTS`

```nohighlight
root@nodejs-s-1vcpu-1gb-nyc3-01:/etc/apache2/sites-enabled# ls -l /var/www/matthewalbertcole.com/.well-known/acme-challenge/
total 4
-rw-r--r-- 1 root root 2 Oct 15 03:53 Test-File
root@nodejs-s-1vcpu-1gb-nyc3-01:/etc/apache2/sites-enabled# sudo apachectl -t -D DUMP_VHOSTS
VirtualHost configuration:
*:443 is a NameVirtualHost
         default server www.matthewalbertcole.com (/etc/apache2/sites-enabled/matthewalbertcole.com-le-ssl.conf:2)
         port 443 namevhost www.matthewalbertcole.com (/etc/apache2/sites-enabled/matthewalbertcole.com-le-ssl.conf:2)
         port 443 namevhost matthewalbertcole.com (/etc/apache2/sites-enabled/matthewalbertcole.com-le-ssl.conf:12)
         port 443 namevhost www.pdxwater.org (/etc/apache2/sites-enabled/pdxwater.org-le-ssl.conf:2)
         port 443 namevhost pdxwater.org (/etc/apache2/sites-enabled/pdxwater.org-le-ssl.conf:12)
*:80 is a NameVirtualHost
         default server matthewalbertcole.com (/etc/apache2/sites-enabled/matthewalbertcole.com.conf:1)
         port 80 namevhost matthewalbertcole.com (/etc/apache2/sites-enabled/matthewalbertcole.com.conf:1)
                 alias www.matthewalbertcole.com
         port 80 namevhost pdxwater.org (/etc/apache2/sites-enabled/pdxwater.org.conf:1)
                 alias www.pdxwater.org

```

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [October 15, 2021, 4:29am UTC](https://community.letsencrypt.org/t/failed-redirect/163099/20 "2021-10-15T04:29:28Z")

</div>

OK, please show:  
`cat /etc/apache2/sites-enabled/matthewalbertcole.com.conf`

---

<div class="post-metadata">

**Author:** ![matthewcole805](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@matthewcole805](https://community.letsencrypt.org/u/matthewcole805)\
**Post date:** [October 15, 2021, 4:29am UTC](https://community.letsencrypt.org/t/failed-redirect/163099/21 "2021-10-15T04:29:29Z")

</div>

I don't know where it went, but I'm up a trust level now so hopefully it doesn't happen again.

---

<div class="post-metadata">

**Author:** ![matthewcole805](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@matthewcole805](https://community.letsencrypt.org/u/matthewcole805)\
**Post date:** [October 15, 2021, 4:30am UTC](https://community.letsencrypt.org/t/failed-redirect/163099/22 "2021-10-15T04:30:36Z")

</div>

> [@rg305](#):
>
> cat /etc/apache2/sites-enabled/matthewalbertcole.com.conf

```nohighlight
root@nodejs-s-1vcpu-1gb-nyc3-01:/etc/apache2/sites-enabled# cat /etc/apache2/sites-enabled/matthewalbertcole.com.conf
<VirtualHost *:80>

        ServerAdmin root@matthewalbertcole.com
        DocumentRoot /var/www/matthewalbertcole.com/
        ServerName matthewalbertcole.com
	ServerAlias www.matthewalbertcole.com

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        RewriteEngine On
	RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge [NC]
  	RewriteCond %{HTTPS} !=on
  	RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

        #ProxyRequests On
        #ProxyPass / https://localhost:8080/
        #ProxyPassReverse / localhost:8080/

</VirtualHost>

```

[Next page](https://community.letsencrypt.org/t/failed-redirect/163099.md?page=2)
