1

I move my Lumen Project to Ubuntu.

I cant access to defined routes without index.php.

I can access to routes in this way:

public/index.php/api/user

I tried the command a2enmod rewrite and restart apache2 but this not work for me. I do not know if is the file .htaccess in the public file.

Any help?

Mike Rockétt
  • 8,947
  • 4
  • 45
  • 81
Jhonny Afonso
  • 291
  • 4
  • 14

2 Answers2

2

move .htaccess and index.php on folder public to root folder your project open index.php and then rename

$app = require DIR.'/../bootstrap/app.php'; to $app = require DIR.'/bootstrap/app.php';

Note, while copy pasting underscore sign is not being copied.

1

Put this in .htaccess

RewriteEngine On
RewriteBase /

RewriteCond %{THE_REQUEST} /index [NC]    
RewriteRule ^ / [R=302,L,NE]  

see this how-to-remove-public-from-url-in-laravel
and this Remove index.php from url Laravel 5

Community
  • 1
  • 1
paranoid
  • 6,799
  • 19
  • 49
  • 86