Problems implementing TinyMCE in CodeIgniter

◇◆丶佛笑我妖孽 提交于 2019-11-29 18:03:04
Hashem Qolami

You are not allowed to call a file within the application folder, take a look at .htaccess file exists in application:

Deny from all

you'll get 403 error Access forbidden!

Anyway, this problem would no be resolved by disabling that line, because CodeIgniter looks at the URI and says: "Okay, I should call application class which exists in controller folder and then call the tinymce method by passing these arguments: jscripts, tiny_mce, tiny_mce.js".

So:

  1. Put your files out of application/ folder, somewhere like public/ folder beside index.php.
  2. Open .htaccess file which exists in the root, and add name of files/folders to prevent them from being passed through index.php.

For instance, considering this structure:

system/
application/
public/
      img/
      css/
      js/
.htaccess
index.php
robots.txt

The rewrite rules (.htaccess) should be:

RewriteEngine on
RewriteCond $1 !^(index\.php|public|robots\.txt)
#                               |
#   Exclude the public folder <--
#   From being treated by:
RewriteRule ^(.*)$ index.php/$1 [L]

Take a look at CodeIgniter User Guide for more info.

Please make sure there is no js error in your project and also the path of js related to the editor is correct so the js can work for the editor.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!