# Non https redirects to old domain, after domain change

**URL:** <https://community.letsencrypt.org/t/non-https-redirects-to-old-domain-after-domain-change/139399>\
**Category:** Help\
**Created:** [November 30, 2020, 2:21pm UTC](https://community.letsencrypt.org/t/non-https-redirects-to-old-domain-after-domain-change/139399 "2020-11-30T14:21:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![wtzr](https://avatars.discourse-cdn.com/v4/letter/w/9e8a1a/32.png) [@wtzr](https://community.letsencrypt.org/u/wtzr)\
**Post date:** [November 30, 2020, 2:21pm UTC](https://community.letsencrypt.org/t/non-https-redirects-to-old-domain-after-domain-change/139399/1 "2020-11-30T14:21:00Z")

</div>

I'm in the dark on this one.

We changed our domain names from [pelvicpaintest.com](http://pelvicpaintest.com) to pelvic.pro. I've revoked and deleted the old certificate for [pelvicpaintest.com](http://pelvicpaintest.com) and created a new one for www.pelvic.pro and pelvic.pro.

If I now go to pelvic.pro it redirects to the old domain [pelvicpaintest.com](http://pelvicpaintest.com). However, if I go directly go to [https://pelvic.pro](https://pelvic.pro) it works.

I'm not sure where the redirect is set, and how I can remove it.

Thanks!

My domain is:  
Pelvic.pro

I ran this command:  
sudo certbot certonly

It produced this output:  
_How would you like to authenticate with the ACME CA?_  
_- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -_  
_1: Apache Web Server plugin (apache) [Misconfigured]_  
_2: Spin up a temporary webserver (standalone)_  
_3: Place files in webroot directory (webroot)_  
_- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -_  
_Select the appropriate number [1-3] then [enter] (press 'c' to cancel): 3_  
_Plugins selected: Authenticator webroot, Installer None_  
_Please enter in your domain name(s) (comma and/or space separated) (Enter 'c'_  
_to cancel): www.pelvic.pro,pelvic.pro_  
_Obtaining a new certificate_

IMPORTANT NOTES:

- Congratulations! Your certificate and chain have been saved at:  
/etc/letsencrypt/live/www.pelvic.pro/fullchain.pem  
Your key file has been saved at:  
/etc/letsencrypt/live/www.pelvic.pro/privkey.pem  
Your cert will expire on 2021-02-28. To obtain a new or tweaked  
version of this certificate in the future, simply run certbot  
again. To non-interactively renew _all_ of your certificates, run  
"certbot renew"

- If you like Certbot, please consider supporting our work by:

My web server is (include version):  
Ubuntu

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

My hosting provider, if applicable, is:  
Digital ocean

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):

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

---

<div class="post-metadata">

**Author:** ![JuergenAuer](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/juergenauer/32/26491_2.png) [@JuergenAuer](https://community.letsencrypt.org/u/JuergenAuer)\
**Post date:** [November 30, 2020, 2:27pm UTC](https://community.letsencrypt.org/t/non-https-redirects-to-old-domain-after-domain-change/139399/2 "2020-11-30T14:27:11Z")

</div>

Hi @wtzr

> [@wtzr](#):
>
> If I now go to pelvic.pro it redirects to the old domain [pelvicpaintest.com](http://pelvicpaintest.com). However, if I go directly go to [https://pelvic.pro](https://pelvic.pro) it works.

there is a wrong redirect. So remove it - see [https://check-your-website.server-daten.de/?q=pelvic.pro](https://check-your-website.server-daten.de/?q=pelvic.pro)

| Domainname | Http-Status | redirect | Sec. | G |
| --- | --- | --- | --- | --- |
| • [http://pelvic.pro/](http://pelvic.pro/) 167.172.33.81 | 301 | [https://pelvicpaintest.com/](https://pelvicpaintest.com/) Html is minified: 100,00 % | 0.033 | E |
| | | | | |
| • [http://www.pelvic.pro/](http://www.pelvic.pro/) 167.172.33.81 | 301 | [https://pelvicpaintest.com/](https://pelvicpaintest.com/) Html is minified: 100,00 % | 0.030 | E |
| | | | | |
| • [https://pelvic.pro/](https://pelvic.pro/) 167.172.33.81 | 301 | [https://www.pelvic.pro/](https://www.pelvic.pro/) | 2.610 | B |
| | | | | |
| • [https://pelvicpaintest.com/](https://pelvicpaintest.com/) | 301 | [https://www.pelvic.pro/](https://www.pelvic.pro/) | 2.503 | N |
| Certificate error: RemoteCertificateNameMismatch | | | | |
| | | | | |
| • [https://www.pelvic.pro/](https://www.pelvic.pro/) 167.172.33.81 GZip used - 9160 / 42186 - 78,29 % Inline-JavaScript (∑/total): 26/7769 Inline-CSS (∑/total): 1/283 | 200 | Html is minified: 142,65 % | 2.640 | I |

Yep, wrong redirects.

First step: What says

```nohighlight
apachectl -S

```

PS: That's not a certificate problem, that's only a wrong redirect.

---

<div class="post-metadata">

**Author:** ![wtzr](https://avatars.discourse-cdn.com/v4/letter/w/9e8a1a/32.png) [@wtzr](https://community.letsencrypt.org/u/wtzr)\
**Post date:** [November 30, 2020, 2:35pm UTC](https://community.letsencrypt.org/t/non-https-redirects-to-old-domain-after-domain-change/139399/3 "2020-11-30T14:35:24Z")

</div>

Hi Juergen,

Thanks for your help. I already wondered whether it would be a redirect or ssl problem. However, i don't have a clue how to solve it.

apachectl -S:

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message  
VirtualHost configuration:  
\*:443 [pelvicpaintest.com](http://pelvicpaintest.com) (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)  
\*:80 [pelvicpaintest.com](http://pelvicpaintest.com) (/etc/apache2/sites-enabled/000-default.conf:4)  
ServerRoot: "/etc/apache2"  
Main DocumentRoot: "/var/www/html"  
Main ErrorLog: "/var/log/apache2/error.log"  
Mutex watchdog-callback: using\_defaults  
Mutex rewrite-map: using\_defaults  
Mutex ssl-stapling-refresh: using\_defaults  
Mutex ssl-stapling: using\_defaults  
Mutex ssl-cache: using\_defaults  
Mutex default: dir="/var/run/apache2/" mechanism=default  
Mutex mpm-accept: using\_defaults  
PidFile: "/var/run/apache2/apache2.pid"  
Define: DUMP\_VHOSTS  
Define: DUMP\_RUN\_CFG  
User: name="www-data" id=33  
Group: name="www-data" id=33

I guess here is indeed the problem, do i need to change those to pelvic.pro?

---

<div class="post-metadata">

**Author:** ![JuergenAuer](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/juergenauer/32/26491_2.png) [@JuergenAuer](https://community.letsencrypt.org/u/JuergenAuer)\
**Post date:** [November 30, 2020, 2:41pm UTC](https://community.letsencrypt.org/t/non-https-redirects-to-old-domain-after-domain-change/139399/4 "2020-11-30T14:41:29Z")

</div>

???

Why isn't there a vHost with your new domain name?

Please change that. Then you will find the wrong redirect.

---

<div class="post-metadata">

**Author:** ![wtzr](https://avatars.discourse-cdn.com/v4/letter/w/9e8a1a/32.png) [@wtzr](https://community.letsencrypt.org/u/wtzr)\
**Post date:** [November 30, 2020, 3:09pm UTC](https://community.letsencrypt.org/t/non-https-redirects-to-old-domain-after-domain-change/139399/5 "2020-11-30T15:09:31Z")

</div>

Hi Juergen,

I tried to follow some tutorials on that. I'm sorry but this is all new to me. I currently have the following setup, but i guess that is also not the right one.

How do I create a new vhost for the domain name correctly?

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message  
VirtualHost configuration:  
\*:443 pelvic.pro (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)  
\*:80 is a NameVirtualHost  
default server pelvic.pro (/etc/apache2/sites-enabled/000-default.conf:4)  
port 80 namevhost pelvic.pro (/etc/apache2/sites-enabled/000-default.conf:4)  
alias www.pelvic.pro  
port 80 namevhost pelvic.pro (/etc/apache2/sites-enabled/pelvic.pro.conf:4)  
alias www.pelvic.pro  
ServerRoot: "/etc/apache2"  
Main DocumentRoot: "/var/www/html"  
Main ErrorLog: "/var/log/apache2/error.log"  
Mutex mpm-accept: using\_defaults  
Mutex watchdog-callback: using\_defaults  
Mutex rewrite-map: using\_defaults  
Mutex ssl-stapling-refresh: using\_defaults  
Mutex ssl-stapling: using\_defaults  
Mutex ssl-cache: using\_defaults  
Mutex default: dir="/var/run/apache2/" mechanism=default  
PidFile: "/var/run/apache2/apache2.pid"  
Define: DUMP\_VHOSTS  
Define: DUMP\_RUN\_CFG  
User: name="www-data" id=33  
Group: name="www-data" id=33

---

<div class="post-metadata">

**Author:** ![wtzr](https://avatars.discourse-cdn.com/v4/letter/w/9e8a1a/32.png) [@wtzr](https://community.letsencrypt.org/u/wtzr)\
**Post date:** [November 30, 2020, 3:23pm UTC](https://community.letsencrypt.org/t/non-https-redirects-to-old-domain-after-domain-change/139399/6 "2020-11-30T15:23:05Z")

</div>

Nevermind, i found the problem. I noticed the little redirect area in the virtualhost which was still [pelvicpaintest.com](http://pelvicpaintest.com).. it works now. Thanks for your help.

---

<div class="post-metadata">

**Author:** ![JuergenAuer](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/juergenauer/32/26491_2.png) [@JuergenAuer](https://community.letsencrypt.org/u/JuergenAuer)\
**Post date:** [November 30, 2020, 3:26pm UTC](https://community.letsencrypt.org/t/non-https-redirects-to-old-domain-after-domain-change/139399/7 "2020-11-30T15:26:50Z")

</div>

> [@wtzr](#):
>
> How do I create a new vhost for the domain name correctly?

Not required, you have already found the solution - renaming is enough. 👍

Now the output looks ok.

```nohighlight
apachectl -S

```

is a very helpful command.

---

<div class="post-metadata">

**Author:** ![Osiris](https://avatars.discourse-cdn.com/v4/letter/o/839c29/32.png) [@Osiris](https://community.letsencrypt.org/u/Osiris)\
**Post date:** [November 30, 2020, 3:40pm UTC](https://community.letsencrypt.org/t/non-https-redirects-to-old-domain-after-domain-change/139399/8 "2020-11-30T15:40:30Z")

</div>

> [@JuergenAuer](#):
>
> Now the output looks ok.

Not really, there are now two HTTP vhosts in two separate files: `pelvic.pro.conf` as wel as `000-default.conf`.

This might lead to issues in future renewals.

Also, I don't see a `www.pelvic.pro` alias in the HTTPS vhost.

---

<div class="post-metadata">

**Author:** ![wtzr](https://avatars.discourse-cdn.com/v4/letter/w/9e8a1a/32.png) [@wtzr](https://community.letsencrypt.org/u/wtzr)\
**Post date:** [November 30, 2020, 3:57pm UTC](https://community.letsencrypt.org/t/non-https-redirects-to-old-domain-after-domain-change/139399/9 "2020-11-30T15:57:37Z")

</div>

Does this look better?

VirtualHost configuration:  
\*:443 pelvic.pro (/etc/apache2/sites-enabled/000-default-le-ssl.conf:2)  
\*:80 pelvic.pro (/etc/apache2/sites-enabled/000-default.conf:4)  
ServerRoot: "/etc/apache2"  
Main DocumentRoot: "/var/www/html"  
Main ErrorLog: "/var/log/apache2/error.log"  
Mutex ssl-cache: using\_defaults  
Mutex default: dir="/var/run/apache2/" mechanism=default  
Mutex mpm-accept: using\_defaults  
Mutex watchdog-callback: using\_defaults  
Mutex rewrite-map: using\_defaults  
Mutex ssl-stapling-refresh: using\_defaults  
Mutex ssl-stapling: using\_defaults  
PidFile: "/var/run/apache2/apache2.pid"  
Define: DUMP\_VHOSTS  
Define: DUMP\_RUN\_CFG  
User: name="www-data" id=33  
Group: name="www-data" id=33

---

<div class="post-metadata">

**Author:** ![Osiris](https://avatars.discourse-cdn.com/v4/letter/o/839c29/32.png) [@Osiris](https://community.letsencrypt.org/u/Osiris)\
**Post date:** [November 30, 2020, 4:06pm UTC](https://community.letsencrypt.org/t/non-https-redirects-to-old-domain-after-domain-change/139399/10 "2020-11-30T16:06:21Z")

</div>

In essence, yes. The double vhosts are gone, which is good. But now your `www` subdomain aliases are gone entirely too? I would suggest adding them back in both vhosts.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [December 30, 2020, 4:06pm UTC](https://community.letsencrypt.org/t/non-https-redirects-to-old-domain-after-domain-change/139399/11 "2020-12-30T16:06:31Z")

</div>

Closed on December 30, 2020, 4:06pm UTC

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