5

I'm trying to install the JustBoil.me image upload plugin for TinyMCE HTML editor as part of a CakePHP application.

However, when I try to upload an image it gets nowhere. Investigation reveals the following two requests are 404ing:

http://my.sites/myapp/js/tinymce/plugins/jbimages/ci/index.php/blank http://my.sites/myapp/js/tinymce/plugins/jbimages/ci/index.php/upload/english

Sure enough, when I try to access http://my.sites/myapp/js/tinymce/plugins/jbimages/ci/index.php/blank in a browser I get a 404 Page Not Found. However, I get a different result from expanding this url to http://my.sites/myapp/app/webroot/js/tinymce/plugins/jbimages/ci/index.php/blank.

My .htaccess files are standard for CakePHP (I think), i.e. in myapp:

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>

in app much the same (but for webroot instead of app/webroot) and then in webroot:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

Is there something simple I can do to make sure that http://my.sites/myapp/js/tinymce/plugins/jbimages/ci/index.php doesn't flake out due to (?) the lack of /app/webroot/ in the path?

thesunneversets
  • 2,560
  • 3
  • 28
  • 46
  • @thesunnerversets I came across with the same issue. checkout `jbimages/ci/system/core/Uri.php -> _detect_uri()`. something's incorrect because of the redirection of the first .htaccess when it's comparing `$uri` with `$_SERVER['SCRIPT_NAME']`. haven't found good solution for this yet. let me know if you find any – ivantedja Feb 17 '14 at 18:04

2 Answers2

0

I mean, here's my very bad solution, which appears to work:

Change the paths in the jbimages dialog to the form:

http://my.sites/matadev/app/webroot/js/tinymce/plugins/jbimages/ci/index.php/blank

and the 'img_path' in jbimages' config.php to

/myapp/app/webroot/img

but obviously this is just stepping around the problem, and avoiding a real understanding of why CakePHP's .htaccess setup is ceasing to work once inside the depths of the TinyMCE plugin...

thesunneversets
  • 2,560
  • 3
  • 28
  • 46
0

i want to comment this but i cant comment

i use ckeditor with kcfinder

http://cakephpclues.blogspot.de/2012/01/ckeditor-kcfinder-integration-with.html

on my opinion these are better than tinymce & ...