How to renew certificate for redirected domain

I’m not able to renew a certificate for a domain because it gets redirected to a different domain. Currently in the .htaccess file I have the following:

RewriteEngine on
Redirect permanent /

Is there any way to keep the domain redirected but also be able to renew the certificate for that redirected domain? I tried this but it didn’t work:

RewriteEngine On
RewriteRule ^\.well-known($|/) - [L]
Redirect permanent /

My server OS is CentOS Linux 7.5.1804, running Apache 2.4.6.


Hi @MontyHu,

In this case you should not use Redirect, use another RewriteRule:

RewriteEngine on
RewriteRule ^\.well-known/ - [L]
RewriteRule (.*)$1 [R,L]


1 Like

That did it, thanks a lot!

1 Like

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