Welcome Guest, Not a member yet? Register   Sign In
Code Igniter static files with PHP 5.4 built in web server
#1

[eluser]Unknown[/eluser]
Hello everyone. I've been trying to make my static files in CodeIgniter to show up when launching the site from PHP 5.4's built in web server.

I am aware that I need to route static files in case php is running from CLI via
Code:
$filename = __DIR__.preg_replace('#(\?.*)$#', '', $_SERVER['REQUEST_URI']);
if (php_sapi_name() === 'cli-server' && is_file($filename)) {
    return false;
}
but not sure exactly where to place this piece of code.

Tried to include it in index.php and application/config/routes.php but that didn't work.

Thanks for the help.




Theme © iAndrew 2016 - Forum software by © MyBB