Question: I want to check if excerpt is not empty, then echo the excerpt link, if not the echo permalink, like this:

`if(the_excerpt()!='') echo the_excerpt(); else echo get_permalink()`
but how can I check if the excerpt field is empty without using the content when empty?

Any help will be appreciated.

Answer: 
I am answering this old question, as it still remains unanswered. Instead of using the plugin, you should use cPanel to redirect HTTP to HTTPS. It will help you to get rid of the infinite redirection loop issue. Follow these steps:

1. Login to your cPanel account.
2. Click on the **File Manager**.
3. Ensure that public\_html directory is being displayed. Scroll
down and search for the .htaccess file. If you don't see the file,
head to Settings at the top-right corner. Then check the box to show
hidden files for document root.
4. Next, a pop up box will appear. Click on the **Edit** button to confirm
encoding.
5. A new tab will show up. It will contain the codes of .htaccess. Copy
and pasted this code to .htaccess file:

```
RewriteEngineOn
RewriteCond%{HTTPS}off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

```
6. Finally, save the changes.

You can find more information about these steps [here](https://hostadvice.com/how-to/how-to-force-ssl-and-manage-the-non-ssl-page-using-cpanel/). 

If you see mixed content and face trouble with the redirection, you will have to use [Really Simple SSL](https://wordpress.org/plugins/really-simple-ssl/) plugin. It will fix the issue completely.
Put this code in `.htaccess` file: 

```
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

```