My Wordpress website is located at example.com/wordpress and I need everything inside to be accessible only using SSL.
I've created a .htaccess rule that redirects http -> https:
RewriteEngine On
RewriteRule ^/?(.*) https://%{SERVER_NAME}/wordpress/directory/$1 [R,L]
After implementing this rule the website is inaccessible as it is stuck in a redirect loop.
What am I doing wrong?
My Wordpress .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/directory/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/directory/index.php [L]
</IfModule>