From 80899d8c3ab76aca1b4fa759d9fb4d8ffc6a8d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Br=C3=A4u?= Date: Thu, 30 Jan 2025 15:54:11 +0100 Subject: [PATCH] add htaccess to make it work on apache setups --- .env.test | 1 + config/bootstrap.php | 4 ++-- public/.htaccess | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 public/.htaccess diff --git a/.env.test b/.env.test index eab9a63..2131f6c 100644 --- a/.env.test +++ b/.env.test @@ -1,5 +1,6 @@ # define your env variables for the test env here KERNEL_CLASS='App\Kernel' APP_SECRET='$ecretf0rt3st' +APP_ENV=test SYMFONY_DEPRECATIONS_HELPER='max[total]=320' DATABASE_URL="sqlite:///%kernel.project_dir%/var/testdata.db" \ No newline at end of file diff --git a/config/bootstrap.php b/config/bootstrap.php index 51180d6..074b1e7 100644 --- a/config/bootstrap.php +++ b/config/bootstrap.php @@ -9,8 +9,8 @@ } $env = $_SERVER['APP_ENV'] ?? 'dev'; -if ($env === 'prod' && file_exists(dirname(__DIR__).'/.env.production')) { - (new Dotenv())->usePutenv()->overload(dirname(__DIR__).'/.env.production'); +if ($env === 'prod' && file_exists(dirname(__DIR__).'/.env.prod')) { + (new Dotenv())->usePutenv()->overload(dirname(__DIR__).'/.env.prod'); } if ($env === 'test' && file_exists(dirname(__DIR__).'/.env.test')) { (new Dotenv())->usePutenv()->overload(dirname(__DIR__).'/.env.test'); diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..8d0cc10 --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,6 @@ + + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^(.*)$ index.php [QSA,L] + \ No newline at end of file