Add domain name to certificate with letsencrypt-win-simple

Hello,

I used letsencrypt-win-simple and created a certificate for domain1.com. The way I ran it I selected the number for the host and it created a domain.com certificate just fine. Today I find out I needed to create www.domain1.com and domain1.com. What do I have to do to fix this issue.
Thank You,

Joe

Hi @jbucar, I edited the title of the thread in the hope of attracting more people with relevant expertise.

1 Like

Hello,

I think you should reconsider your approach. Having 2 sites with the same content, e.g. domain1.com and www.domain1.com is rarely considered as a good practice. SEO will warn you about double content and thus bad page ranking.
Here is my suggestion

If necessary you install the optional rewriting module of IIS https://www.iis.net/downloads/microsoft/url-rewrite

You put theses rules in the web.config

    <rewrite>
            <rules>
				<rule name="domain1.com vers www" stopProcessing="true">
					 <match url=".*" />
					 <conditions>
						 <add input="{HTTP_HOST}" pattern="^domain1.com" />                 
					 </conditions>
					 <action type="Redirect" url="https://www.domain1.com/{R:0}" />
				</rule>
				
				<rule name="Redirect to HTTPS" stopProcessing="true">
					<match url="(.*)" />
					<conditions>
                        <add input="{HTTPS}" pattern="^OFF$" />
					</conditions>
					<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
				</rule>        
</rewrite>

The result is the following : when a user arrives on http://domain1.com or http://www.domain1.com, he is automatically redirected to https://www.domain1.com. The same for search engine bots.

Best regards,

Guy

Hello,

Thank You for the response. I created another binding for the website www.domain1.com and the cert recognized the cert.

Thanks for the help,

Joe

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