htaccess conflict

Permalink
Hi,

we have a C5 site with pretty urls enabled and working well. our htaccess file also forces a redirect for the use of https.

the front end works perfectly. the problem is, when we try save an edited a page, we get an error. the error appears in a modal window with the header 'Error' and then what looks like the raw html from the page we are editing.

we find that if we comment out 2 lines in the htaccess file, we can edit the page.

attached is a screenshot of the error.
and below is the content of our htaccess file (see the commented lines)

# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]  
## hide the following two lines when editing content in C5
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ https://www.<ourdomainname>.co.za/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
# -- concrete5 urls end --


can anyone please help us understand what we have done wrongin our htaccess file?
thanks so much :)

1 Attachment