How to make a redirect link in wordpress?

Check out 301 redirect plugin
https://wordpress.org/plugins/simple-301-redirects/

OR

Add redirect rule in to .htaccess file

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301,NC]

RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

error code: 523