https redirect wordpress code example
Example 1: https redirect htaccess
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Example 2: .htaccess redirect to https
RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.yourdomain.com/$1
Example 3: inner pages redirecting to the https wordpress
My issue was resolved by checking the log file of the website and found the
.htaccess permission was '640' and updated to the '755' and worked like charm!
Permission denied: [client IP:57563] AH00529:
/var/www/html/WEB_FOLDER/public_html/wp-content/uploads/.htaccess
pcfg_openfile: unable to check htaccess file, ensure it is readable and that
'/var/www/html/WEB_FOLDER/public_html/wp-content/uploads/' is executable