Potential Security Risk Ahead Error on non-www urls

Posted June 18, 2020 2.3k views

My issue is when I open my website without WWW then it doesn’t redirect to, in result page doesn’t open up and shows ‘Security Error’ like this:

Warning: Potential Security Risk Ahead

Firefox detected a potential security threat and did not continue to If you visit this site, attackers could try to steal information like your passwords, emails, or credit card details.

When i click on the Advanced Button given there, then it shows this.

Websites prove their identity via certificates. Firefox does not trust this site because it uses a certificate that is not valid for The certificate is only valid for


my .htaccess code is:

<IfModule mod_rewrite.c>
 RewriteEngine On
  RewriteBase /

  RewriteCond %{HTTP_HOST} ^admecindia\.co\.in$ [NC]
  RewriteRule ^(.*)$$1 [L,R=301]

  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]



edited by MattIPv4

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi there @ravibhadauria143,

It looks like that your Let’s Encrypt was issued only for the www version of your domain name.

I would recommend issuing a new SSL certificate which would include both the non-www and the www version.

To do that, I would recommend following the steps from this tutorial here:

Basically, when you run the certbot command, you need to make sure that you specify the two versions:

  • sudo certbot --apache -d your_domain -d www.your_domain

Hope that this helps!

by Kathleen Juell
by Erika Heidi
Let's Encrypt is a Certificate Authority (CA) that provides an easy way to obtain and install free TLS/SSL certificates, thereby enabling encrypted HTTPS on web servers. In this tutorial, you will use Certbot to obtain a free SSL certificate for Apache on Ubuntu 18.04 and set up your certificate to renew automatically.