<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
	RewriteRule ^(.*)$ public/$1 [L]
	RewriteRule \.(gif|jpg|xls|xlsx|ppt|pptx|png)$ - [F]
RewriteCond %{HTTPS} off 
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

# Block WordPress xmlrpc.php requests
<Files xmlrpc.php>
order deny,allow
deny from all
</Files>
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteCond %{HTTP_HOST} ^portal\.udata\.co\.za$ [OR]
RewriteCond %{HTTP_HOST} ^www\.portal\.udata\.co\.za$
RewriteRule ^/?$ "https\:\/\/portal\.udata\.co\.za\/" [R=301,L]
