0

When I press Browse Server button in Image Properties dialogue box of ckeditor/ckfinder then it shows homepage of the website rather than actually showing the images uploaded in userfiles folder. Also I can't able to upload the images in Upload tab. I have an htaccess file in the root folder of my site whose code looks like below:

#Enable mod rewrite
Options +FollowSymlinks -MultiViews
RewriteEngine on


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

I integrated ckeditor with ckfinder with the help of following code:

// Integration of ckfinder with ckeditor for multiple textareas
var opt = {
    filebrowserBrowseUrl: "ckfinder/ckfinder.html",
    filebrowserImageBrowseUrl: "ckfinder/ckfinder.html?type=Images",
    filebrowserFlashBrowseUrl: "ckfinder/ckfinder.html?type=Flash",
    filebrowserUploadUrl: "ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files",
    filebrowserImageUploadUrl: "ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images",
    filebrowserFlashUploadUrl: "ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash",
    filebrowserWindowWidth: "1000",
    filebrowserWindowHeight: "700"
}

$(".editor").each(function(){
    CKEDITOR.replace( $(this).attr("id"), opt );
});

When I try to upload the image in ckeditor, I get the homepage of website in a weird way. The baseurl and basedir are set correct and everything seems to be OK.

Can you please tell me what can be the problem and how can I resolve it.

Sachin
  • 1,646
  • 3
  • 22
  • 59
  • Look at the *Network* tab of your browser's debugger to view the complete URL being requested. Are you sure using relative URLs is correct? Should they begin with a `/`? And/or some other prefix? – Walf Sep 08 '17 at 11:12
  • But when to look at the network tab? Which relative urls you are talking about. Integration of ckeditor with ckfinder is done like the same way that I gave above in my various sites and it works without any issue. – Sachin Sep 08 '17 at 14:24
  • Really? Open the Network tab, refresh the page if you can't see those URLs. They'll be there in the list somewhere. All the URLs in your `opt` are relative to the current directory, whatever that is. – Walf Sep 11 '17 at 03:04
  • I think whatever you are asking me to investigate has nothing to do with my problem. Its all causing due to htaccess. The rule is forcing ckeditor to redirect to weird site homepage. – Sachin Sep 11 '17 at 06:10
  • Good luck to you, then. Those `RewriteCond`s mean "don't apply this rule to actual files, directories, or links thereto", so either those files don't exist at the full URL being requested (why I suggested looking at them), or something outside of your `.htaccess` is interfering with your request. If you can't verify (and tell us) what actual requests are being made, no one can help you. – Walf Sep 11 '17 at 06:16

1 Answers1

0

I recently ran into the same problem in a code igniter project, check my correctly answered question here. In summary, my sessions were not working so I added a few lines of code to create a code igniter instance to be able to use session like $CI->session->userdata('ckfinder_baseUrl'); But it was the creation of the Ci instance on the top of ckfinder config.php that keep causing the redirecting of connector.php to my homepage. If you have a similar setup, remove the foreign code in the ckfinder config.php or respective file that might cause redirects.

Lazarus-CG
  • 76
  • 7