Welcome Guest, Not a member yet? Register   Sign In
Ignoring non-CI (3rd party) php pages
#1

[eluser]forby[/eluser]
I've recently run into a problem.

I built a little CMS for a client using CI and FreakAuth Lite, where they can edit content using TinyMCE, along with a plugin called iBrowser to upload photos directly within the WYSIWYG editor. Well, iBrowser uses a few php files to work, and whenever I try to open the plugin, it displays a 404 page after trying to pass it through the CI controllers.

I didn't think it was a CI problem at first though, because I installed this plugin maybe 2 months ago, and it worked fine until about 2 weeks ago. But the only solution i can think of is to just tell CI to ignore the php files within a folder to let it do what it's supposed to, without getting caught in the CI system.

I've tried every other thing i can think of.

If anyone could shed some light on this, it would be GREATLY appreciated.

thanks
#2

[eluser]spheroid[/eluser]
Not quite clear what you're trying to do. Are you putting .php files within your webroot, and need those to work "as normal", such as:

Code:
webroot/
  html/
    testfile.php

...and you're trying to get it so http://mysite.dev/testfile.php will display that page?
#3

[eluser]forby[/eluser]
[quote author="spheroid" date="1210386815"]Not quite clear what you're trying to do. Are you putting .php files within your webroot, and need those to work "as normal", such as:

Code:
webroot/
  html/
    testfile.php

...and you're trying to get it so http://mysite.dev/testfile.php will display that page?[/quote]

sort of. I want a .php page to run completely separate from the CodeIgniter system. It might be a setting i need to change in the routes file, but say i have a file here:

Code:
(root)/public/frontend/myfile.php

I want that file to run without CodeIgniter trying to match it with a controller. Because at the moment, when that file runs, it produces a CI 404 error page, instead of completing it's functions. So, I'm trying to get CodeIgniter to ignore that page so it can function on it's own.
#4

[eluser]forby[/eluser]
anyone else run into this?
#5

[eluser]spheroid[/eluser]
In your controller function:

Code:
function includetest()
    {
        include("path/to/file/thirdpartyscript.php");
    }
#6

[eluser]Jamie Rumbelow[/eluser]
CodeIgniter doesn't like prematurely outputting things to the browser, that is, using `echo` statement's within controllers.

Does your script output anything to the browser? If so, change everything that it outputs into a variable and pass it on into the view.
#7

[eluser]forby[/eluser]
@spheroid: I'll try that. but can anyone explain why it used to work. the third party script file used to launch fine, creating an upload form for images within the browser window. Now, just causing the CI 404. I don't think anything was changed settings-wise. I really can't explain it. But all of a sudden, all php pages within the [root/public/frontend/] path now try to access the controllers, causing 404 errors. it's weird.

or maybe the weird part is why it worked in the first place, if it apparenlty shouldn't have.
#8

[eluser]nmweb[/eluser]
A proper .htaccess file will first look if the requested file exists and only if it doesn't pass the url on to the index.php
#9

[eluser]forby[/eluser]
[quote author="nmweb" date="1210643771"]A proper .htaccess file will first look if the requested file exists and only if it doesn't pass the url on to the index.php[/quote]

could you elaborate a bit, or point me in the direction of the methods to use? I've only done limited htaccess things. But i'll give it a shot tonight and look around for that kind of fix. sounds like it'd be easier to implement and manage.
#10

[eluser]forby[/eluser]
ok, i found the problem, which was actually a folder and file permissions problem. my htaccess is working correctly. i appreciate the help.




Theme © iAndrew 2016 - Forum software by © MyBB