file_get_contents causes a 404 error |
Hi,
I am working on my first CodeIgniter project - using 3.1 and liking it so far! However I have come across an issue which has stumped me and I haven't found anything online about it. I have a route: Code: $route['storage/item/(:any)'] = 'StorageController/item/$1'; which is handled in the StorageController by: Code: public function item($uniqid) and the view is simply: Code: <?php header('Content-Type: text/plain'); ?> or in other words, just displays the plain text file contents for the $uniqid that is stored in a set location on the webserver. That works fine in the browser with an internal url of (for example) http://www.domain.com/storage/item/57d952d0a09d0 Now, I have a database table that stores URL's which may be external or internal (i.e. in the above example form) for which I want to retrieve the data. That I attempt with file_get_contents: Code: public function load($id) If the stored URL is external (i.e. not under www.domain.com) then the file_get_contents works fine. But for an internal URL it causes a 404 error, despite it displaying when typed into the browser address bar. Can anyone shed some light on what is going on? Many thanks! |
Messages In This Thread |
file_get_contents causes a 404 error - by gordski68 - 09-15-2016, 05:59 AM
RE: file_get_contents causes a 404 error - by dave friend - 09-15-2016, 06:53 AM
RE: file_get_contents causes a 404 error - by salain - 09-15-2016, 06:59 AM
RE: file_get_contents causes a 404 error - by gordski68 - 09-16-2016, 02:04 AM
RE: file_get_contents causes a 404 error - by dave friend - 09-15-2016, 07:42 AM
RE: file_get_contents causes a 404 error - by gordski68 - 09-16-2016, 02:26 AM
RE: file_get_contents causes a 404 error - by gordski68 - 09-16-2016, 02:53 AM
RE: file_get_contents causes a 404 error - by gordski68 - 09-16-2016, 04:28 AM
|