jeudi 26 novembre 2015

Lumen routes not working without index.php

I have lumen installed in Vagrant VM (ubunty/trusty64). in my Vagrantfile have enabled config.vm.network "private_network", ip: "192.168.33.10"

My directory structure inside VM is

var
 - www
  -html
   -app
   -bootstrap
   -database
   .... so on.

I made a virtual host inside VM /etc/apache2/sites-available/api.dukaan.pk with below contents

<VirtualHost *:80>
    ServerAdmin admin@api.dukaan.pk
    ServerName api.dukaan.pk
    ServerAlias www.api.dukaan.pk
    DocumentRoot /var/www/html/public
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Then i enabled it with sudo a2ensite api.dukaan.pk.conf. Restarted apache several times no luck.

Then in my host machine Windows 10 i put 192.168.33.10 api.dukaan.pk

Now in my app/Http/routes.php i defined two routes

$app->get('/', function () use ($app) {
    return $app->welcome();
});
$app->get('/hello', function() {
    return 'Hello World';
});

If i go to http://ift.tt/1MTll48 It works but if i remove index.ph from this url like http://ift.tt/21hQnME it shows 404 page not found error.

There is default .htaccess and index.php file in my app/public directory.

Please help me getting rid of this index.php file

Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire