views:

182

answers:

3

Hi,

Is it possible to use CKeditor which resides outside of your document root inside document root application?

For e.g. I am having directory structure like:

    My Documentroot

    C://xampp/htdocs/example.com

    My CKeditor is outside and parallel to document root say

    C://xampp/lib/ckeditor

How can I call ckeditor.js which is in C://xampp/lib/ckeditor/ckeditor in my application page in C://xampp/htdocs/example.com/editor.php

A: 

../../lib/ckeditor/ckeditor

../ is the parent directory.

henrikh
No Parent directory. As i told lib directory is parallel to my htdocs directory
Asif Mulla
Yes? but `lib` is in `xampp` which is the parent of `htdocs`
henrikh
the problem is that the file is outside the web root and can't be requested in a browser. Using a relative path will fail because it can't "dig" beyond the web root.
Pekka
+1  A: 

Since CKEditor is Javascript it HAS to reside somewhere in your document root, otherwise you won't be able to include it.

wimvds
+1  A: 

If you're on Apache, you could set up an Alias in your site's VirtualHost section in httpd.conf (or httpd-vhosts.conf):

Alias /ckeditor C:/xampp/lib/ckeditor

as @wimvds says, the file must be accessible to the browser somehow.

Pekka
Hi Pekka, when tried http://example.com/ckeditor gives Access forbidden! error. What could be reason?
Asif Mulla
The reason probably is a missing `<Directory "C:/xampp/lib/ckeditor">` with Allow from ... section telling Apache that it is allowed to access the folder.
wimvds
@Asif It's either what @wimvds says, or the directory simply has no index.htm file. Could that be?
Pekka
Thanks Pekka, Its working now.
Asif Mulla
Thanks wimvds and Pekka for help.Its working.
Asif Mulla