Hi
I'm having a problem with the default '/' route in a micro application not found.
I have setup this folder structure;
webroot/
admin/
app/
public/
Under webroot I have this htaccess file;
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]
RewriteRule ^admin/(.*)$ admin/$1 [QSA,L]
under both public and admin I have htaccess;
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^((?s).*)$ index.php?_url=/$1 [QSA,L]
and under both public and admin I have index.php files containing;
$app = new Phalcon\Mvc\Micro($di);
$app->get('/', function() {
echo 'Public Hello'; // (echo 'Admin Hello' in admin)
});
$app->get('/info', function() {
echo 'Public Info'; // (echo 'Admin Info' in admin)
});
$app->handle();
If I browse to <host>/admin, <host>/admin/info, or <host>/info I get the relevant response. However, browsing to <host>/ I get Not Found, when I am expecting 'Public Hello'.
If I browse to <host>/public/ I get the default response, so could it be my rewrite rules in webroot/.htaccess aren't passing the request correctly into the public folder? I've been trying without success to change these, so if anyone can see what I'm doing wrong that would be great.
thanks, Gavin