Why did my word-press site is showing not secure - wordpress

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.

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>

Related

How to redirect multiple domains in bitnami wordpress config

I've searched and haven't been able to find an answer to this. A lot of the information I've found appears to be out of date.
I have a Bitnami wordpress installation, running Apache on a lightsail instance.
I have multiple different domains resolving to the server. At the moment, each domain displays in the browser if you use it
eg
website-address.com - displays in browser
website-address.org - displays in browser
etc
I just want website-address.com to display in the browser with any other domains redirecting to that.
It seems that 301 redirects are not managed by htaccess files any more. As far as I can tell, this should be configured using the virtual hosts configuration in the bitnami.conf file
I currently have two vhosts in that file, one for port 80 and one for 443
There are a number of rewrite conditions in there, rewriting things like www to non www and http to https, all of which work.
I have configured the ServerName to the domain that I want in both virtual hosts and the ServerAlias to match all of the other urls
I have also tried adding:
RewriteCond %{HTTP_HOST} !^{SERVER_NAME}
RewriteRule ^(.*)$ https://{SERVER_NAME}/$1 [R,L]
but the alternate domains are still not redirecting.
Is there something else I need to add? Do I need to configure a vhost for each of the alternate domains and if so, do I just do it for 443 or do I need to do it for port 80 as well?

.htaccess rule to force SSL on only certain domains

I'm running a WordPress multisite network that allows users to optionally use a custom domain name on their websites. Users that opt not to use a custom domain are assigned a subdomain of the WP install (e.g.: fred.example.com, with example.com being the URL the WP multisite network is installed on).
I have a wildcard SSL configured for the main domain, but I do not have certificates available for custom domain names.
What I need is a htaccess rule to force traffic to https if the request is for either example.com or *.example.com, but not if the request is coming in using a custom domain.
It should work as follows:
http://example.com/* → https://example.com/*
http://foo.example.com/* → https://foo.example.com/*
http://customdomain.com/* → http://customdomain.com/*
Try something like the following near the top of your .htaccess file. Using mod_rewrite:
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteCond %{HTTP_HOST} ^(?:[a-z0-9-]+\.)?example\.com
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=302,L]
What this says is... For all requests that are not HTTPS and that match example.com or <subdomain>.example.com then redirect to https:// on the same host, same URL-path.
Note that this doesn't allow www.<subdomain>.example.com (which I assume your SSL cert does not cover anyway).
Change the 302 (temporary) to 301 (permanent) only when you are sure it's working OK.

Unable to load my website subpages after creating ssl certificates without https subpages are opening normally

My web site was working fine via http with postname option in Permalink. Recently I have activated https (i.e. ssl) for my website. After that only home page is working, sub pages are not working. For default Permalink settings https is working. I have purchased wild card ssl certificates from godaddy, they have given me 2crt files. One starts with b811adugdfdfd.crt and another is gd_bundle-g2-g1.crt. I have uploaded both certificates in apache server and a key file. am I doing any mistake?? Website landing page is working with https but not subpages. Thanks in advance. Is the issue with SSL, or .htaceess or permalinks?
If your using "apache" Add directory Permission in SSL configuration of apache
//Directory /var/www/html/demoproject/public //
AllowOverride All
Require all granted
//Directory//
Here are a few quick checks that might help (If your SSL settings are all fine):
Make sure that under General Settings Page you have changed the site address URLs from http://domainname.com to https://domainname.com.
Try to check pages by forcing it to SSL with the help of a plugin WordPress HTTPS.
Write this code in your .htaccess file
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

How to access my single wordpress site via multiple sub-domain

I want to access my single worpress installation site via multiple subdomain without using multisite functionality.
What i have tried, but i have not found the perfect solution:
I have used the MultiDomain plugin but it restricted me to add the multiple domain in array through hardcode, actually i want the subdomain ui plugins that help me to add multiple subdomain like "myname.example.com" to redirect in main wordpress website i.e "example.com".
Thanks in advance
You can configure that easily in apache using NameVirtualHost, no need for a WordPress plugin.
<VirtualHost *:80>
ServerName *.example.com
# for a single subdomain:
#ServerAlias myname.example.com
Redirect permanent / http://example.com
</VirtualHost>
If you don't have direct access to your apache config, you can configure *.example.com to it's own document root (how to do that depends on you hoster, can't give you any concrete examples) and configure the redirect in a .htaccess file:
RewriteEngine On
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]

duplicate pages HTTP and HTTPS in wordpress

When my site is crawled it comes up with duplicate pages one being HTTP and the other HTTPS and have no idea how to fix the issue in wordpress any ideas.
You have to force users to use either HTTP or HTTPS, but not both if you want nice clean search results. The Force SSL Everywhere plugin ( http://wordpress.org/plugins/force-ssl-everywhere/ ) should force SSL to be used no matter what.
On this note you should do also the same with subdomains. You should all redirect users who request www.yourdomain.com to yourdomain.com or vice-versa or to whatever the Wordpress site_url is set to so that there is no ambiguity between the naked domain and the www subdomain.
Have a look here on serving a different robots.txt file via HTTPS.
http://www.webmasterworld.com/google/3411545.htm
It seems that the solution for your problem is setting a proper redirection of HTTP to HTTPS urls. For this you need to add a few lines to your .htaccess code.
If you are having Apace or LiteSpeed hosting try the one below
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
For Nginx type hosting
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
return 301 https://www.yourdomain.com$request_uri;
}
If you still didn't get it right I recommend to read Move WordPress Website from HTTP to HTTPS \ SSL | Guide

Resources