title: Why HTTP request POST and PUT in laravel and .htaccess file of public folder, that works great in local machine, not working in live server?
body: <p>I am building a restful api in laravel 4.2. I developed the api in my local machine and it works great. But, when I migrated it to live server, HTTP POST and PUT request returned the following exception:</p>
  
  <pre><code>Symfony\Component\HttpKernel\Exception\NotFoundHttpException
  </code></pre>
  
  <p>This is my route file.</p>
  
  <pre><code>    Route::group(['prefix' =&gt; 'api/v1'], function(){
          Route::post('login', ['as' =&gt; 'api.v1.users.login', 'uses' =&gt; 'UsersController@login']);
          Route::delete('logout', ['as' =&gt; 'api.v1.users.logout', 'uses' =&gt; 'UsersController@destroy']);
          Route::post('register', ['as' =&gt; 'api.v1.users.register', 'uses' =&gt; 'UsersController@register']);
          Route::put('change-password', ['as' =&gt; 'api.v1.users.change.password', 'uses' =&gt; 'UsersController@update']);
          Route::post('forgot-password', ['as' =&gt; 'api.v1.users.forgot.password', 'uses' =&gt; 'UsersController@forgotPassword']);
          Route::get('recover/{code}', ['as' =&gt; 'api.v1.users.recover', 'uses' =&gt; 'UsersController@recover']);
      });
  </code></pre>
  
  <p>I ran </p>
  
  <pre><code>php artisan routes 
  
      | POST api/v1/login                | api.v1.users.login             | UsersController@login 
      | DELETE api/v1/logout             | api.v1.users.logout            | UsersController@destroy
      | POST api/v1/register             | api.v1.users.register          | UsersController@register
      | PUT api/v1/change-password       | api.v1.users.change.password   | UsersController@update
      | POST api/v1/forgot-password      | api.v1.users.forgot.password   | UsersController@forgotPassword 
      | GET|HEAD api/v1/recover/{code}   | api.v1.users.recover           | UsersController@recover         
  </code></pre>
  
  <p>It shows the uri and it's related controller and methods. I can't figure it out the problem. Do we need to reconfigure laravel for live server? I am using POSTMAN as a rest client.</p>
  
  <p>Also .htaccess file of public folder is not working in live server. I have to write url like</p>
  
  <pre><code>http://somedoman.com/index.php/api/v1/login
  </code></pre>
  
  <p>instead of </p>
  
  <pre><code>http://somedoman.com/api/v1/login
  </code></pre>
  
  <p>why is .htaccess not working when it's exist in public folder? mod_rewrite is enabled. I also changed AllowOverride None to AllowOverride All.</p>
  
  <p>This is the content of .htaccess of public folder.</p>
  
  <pre><code>     &lt;IfModule mod_rewrite.c&gt;
          &lt;IfModule mod_negotiation.c&gt;
              Options -MultiViews
          &lt;/IfModule&gt;
  
          RewriteEngine On
  
          # Redirect Trailing Slashes...
          RewriteRule ^(.*)/$ /$1 [L,R=301]
  
          # Handle Front Controller...
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteRule ^ index.php [L]
      &lt;/IfModule&gt;
  </code></pre>