php - Slim calling endpoint in browser -


i new in slim, want create small website, used slim create api fine when came displaying endpoint in browser stack. restful tester or curl , works fine, when browse : path_to_index/hello ,i 404 error. path_to_index/index.php/hello works. how can change make path_to_index/hello works

here index :

require 'vendor/slim/slim/slim/slim.php'; \slim\slim::registerautoloader(); $app = new \slim\slim();    $app->get('/hello', function () {     echo "hello"; }); $app->run(); 

my .htaccess

rewriteengine on rewritecond %{request_filename} !-f rewriterule ^ index.php [qsa,l] 

  1. be sure place htaccess next index.php - setup.

  2. when using composer require vendor autoloader:

require 'vendor/autoload.php'; 

Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -