Configuration
At this stage, you should properly configure the settings for your web server.
Apache
By default, Flute comes with a built-in .htaccess
file, so if you're using standard hosting, everything should work out of the box.
Here's the standard .htaccess
config:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
Nginx
For Nginx configuration, you'll need the following setup:
note
You need to change 3 parameters to fit your setup:
- (root) The folder location of Flute + public/.
- (server_name) Your domain.
- (fastcgi_pass) The path to your PHP version's socket. The example uses 7.4.
server {
root /var/www/html/public;
server_name site.com;
index index.php;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}