Welcome Guest, Not a member yet? Register   Sign In
Url exceptions
#1

[eluser]jbuda[/eluser]
Hi there

Im trying to link to run a php file that doesnt have anything to do with my codeignter app.
However, each time im trying to run that file (the url is relative) called Interface.php in the directory outside, codeIgniter adds the '/index.php/campaigns/' to the url and attempts to find a function in the controller, this resulting in a page not found.

http://localhost/index.php/campaigns/out...erface.php

Should be this :

http://localhost/outside/Interface.php

My question is this, is there any way that i can set up exceptions to the url that codeIgniter will ignore so that i can run the above url?

Hope that makes sense.
#2

[eluser]bretticus[/eluser]
What is the apache rewrite config you are using currently? Note: You can use rewrite to ignore files and folders that are actually there with the following two RewriteCond statements:

Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
#3

[eluser]jbuda[/eluser]
Unfortunately im not using .htaccess, as this will probably be going onto a windows box with IIS.

Is there anything in codeIgniter to do this? Something in the Routing.php perhaps?
#4

[eluser]wiredesignz[/eluser]
Use an absolute url. or at least an appropriate relative path in your url.
#5

[eluser]jbuda[/eluser]
Thanks for the swift replies.

Unfortunately, the files cannot be modified as it is the core files of another large scale app built by a third party.

The url cannot be made absolute either, as there will be different urls using the same Interface.php that will each require their url to be used.
#6

[eluser]n0xie[/eluser]
[quote author="jbuda" date="1254401450"]Unfortunately im not using .htaccess, as this will probably be going onto a windows box with IIS.

Is there anything in codeIgniter to do this? Something in the Routing.php perhaps?[/quote]
Try using ISAPI filters. We use ISAPI Rewrite by Helicon.
#7

[eluser]jbuda[/eluser]
i would really prefer not to use mod_rewrite... but im guessing that this is the only option?

So CodeIgniter controls all my urls with no exceptions? Is this something that could be considered for future versions? As not everyone would want to use url rewriting to do simple tasks.
#8

[eluser]wiredesignz[/eluser]
n0xie makes a valid point too.

However you could create a controller matching the 'outside/interface' path and use an include or redirect.
#9

[eluser]bretticus[/eluser]
[quote author="jbuda" date="1254401450"]Unfortunately im not using .htaccess, as this will probably be going onto a windows box with IIS.[/quote]

PHP in IIS with Windows? Do people really deploy a production server that way? :-)

I read your post too fast. Don't use anchor() or href="outside/Interface.php". That would be wrong on any webpage. All it takes is an absolute path (as wiredesignz suggested.) or href="/outside/Interface.php" or href="http://localhost/outside/Interface.php".

Cheers!
#10

[eluser]bretticus[/eluser]
[quote author="jbuda" date="1254401782"]
The url cannot be made absolute either, as there will be different urls using the same Interface.php that will each require their url to be used.[/quote]

Disregard my last post. My, how these fly by!




Theme © iAndrew 2016 - Forum software by © MyBB