Remove public/index.php symfony
Setup project demo:
composer create-project symfony/skeleton demo
Bình thường bạn phải truy cập http://localhost/demo/public/index.php thì mới run project được.
Muốn không phải gõ /public/index.php bạn làm như sau:
Copy file index.php trong folder public/index.php ra thư mục root của project
Sau đó sửa dòng số 7
require dirname(__DIR__).'/config/bootstrap.php';
Thành
require __DIR__.'/config/bootstrap.php';
Đồng thời tạo file .htaccess với nội dung như sau:
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.+) index.php?p=$1 [QSA,L]
Tiếp theo gõ http://localhost/demo nếu thấy như sau là bạn đã thành công