-2

I have a new website but it has some SSL issue. Issue is that when i type my website URL without https like only (example.com) in address bar it becomes not secure and when i type https with it like (https://example.com) my site show secure.

I have installed the SSL certificate with my cPanel "Let Encrypt SSL" option. And i have update my urls from http to https in my worpress Settings > General.

Help me with this I want to type my url in address bar without https (example.com) like othere website we usually surf on internet and want it to automatically detect that it is a secure website.

Mubashir
  • 31
  • 1
  • 8

1 Answers1

1

I'm assuming you've already acquired an SSL certificate for your site.

What you want to do is redirect HTTP to HTTPS via your .htaccess file. A quick search will tell you how to do that, it is something like:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.example/$1 [R,L]

Another easy solution is to redirect via your Apache configuration. Navigate to /etc/apache2/sites-available/ and edit your site's config file. Add the following lines:

<VirtualHost *:80>
    ServerName yourdomain.com
    Redirect permanent / https://yourdomain.example/
</VirtualHost>
Patrick Mevzek
  • 10,995
  • 16
  • 38
  • 54
Amr H
  • 58
  • 1
  • 9
  • Thank you for your answer i was searching on the internet for this i didn't find anything use mostly they are showing tutorials of configuring SSL certificate but your solution works and now my site is working fine. – Mubashir Aug 14 '20 at 09:53