fishme / kirby_ckeditor

Visual Editor for Kirby2
GNU General Public License v2.0
10 stars 1 forks source link

Rewrite exception #1

Closed m-artin closed 7 years ago

m-artin commented 7 years ago

what I need here is an exception for this url "/site/fields/ckeditor/assets/*" If you can fix that, please make a pull request.

Nice plugin! The answer to a fix might be found here: http://stackoverflow.com/questions/9502026/htaccess-rewrite-folder-exception

And regarding rewrite rules in general, here is a helpful guide written for humans. https://24ways.org/2013/url-rewriting-for-the-fearful/

m-artin commented 7 years ago

It seems to work with this Rewrite exception:

# block all files in the site folder from being accessed directly
# except for requests to field assets files
RewriteRule ^assets/fields/([a-zA-Z0-9\.\-_%=]+)/(.*)$ site/fields/$1/assets/$2 [L,N]
RewriteCond $1 !^fields/[a-zA-Z0-9\.\-_%=]+/assets/.*
RewriteRule ^site/(.*) index.php [L]

In the latest Kirby .htaccess file you can find these two similar lines on line 29 and 30, which are commented out by the way. I've adjusted these for the fields folder.

fishme commented 7 years ago

yeah looks good. I will update the description. Thanks for the hint.