I created two ASP.NET solutions. One with just a default page that opens the ckFinder control. It works like a charm. No problem.
The second solutions doesn't. It is a Dynamic Data website with both the ckFinder as well as the ckEditor. Whenever I open the ckFinder control I get error "HTTP error 404 - not found". Any idea?
What I find very strange is that I copied the entire ckFinder directory from the project that works. Very strange. I must be missing something simple (I hope).
Thanks,
Peter
Wed, 06/17/2009 - 19:35
#1
Re: http error 404 when ckFinder opens - bug with relative URLs?
More information. This error has to do with the basepath. The first solution from my previous post works when I run it as a web app in Visual Studio. When I publish it to IIS 7 it fails. I get the following error:
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Requested URL http://localhost:80/ckfinder/ckfinder.html?action=js&func=SetFileField&thumbFunc=SetFileField
Physical Path C:\inetpub\wwwroot\ckfinder\ckfinder.html
The request URL should have been "http://localhost:80/test/ckfinder/ckfinder.html" because the web app does not reside in the "default web site" but in an application below the "Default Web site".
If I change all the URLs to full URLs including the protocol, host, web application, etc it works but that cannot be the intention.
Any advise welcome,
Peter
Re: http error 404 when ckFinder opens
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Re: http error 404 when ckFinder opens
Hi Wiktor,
Actually once deployed to a non root IIS website (virtual application or directory) none of the applications work. The problem is the basepath. I found two solutions that work:
1. use a full http reference ex: http://www.test.com/myapp/ckfinder/
==> not very practical because you want to be able to deploy the application to multiple servers without having to make modifications
2. use a relative reference ex: ckfinder/ or ../ckfinder/
==> not very practical either because the path changes depending on where you are in you website hierarchy
What doesn't work is "/ckfinder/" or "~/ckfinder/". Those produce the results described in my previous post.
It seems that you need to work on the routine that builds the path for ckfinder.html.
The problem is easy to reproduce.
1. Create a standard Visual Studio ASP.net web project
2. Add ckfinder with all defaults
3. Add the ckfinder control to the default.aspx page
3. Change the security setting so that CKFinder can run
4. Run the app in debug mode ==> this wil work
5. Deploy the app to a IIS server but not in a web root (not wwwroot) but in a virtual folder or virtual application.
6. Connect to the app ==> this will fail with error 404.