Check if this is missing in your apache.ini:
DirectoryIndex index.php index.html
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I've created an alias on apache server conf file (/etc/apache2/mods-enabled/alias.conf) to target the public folder.
Alias /laravel/ "/home/user/dev/web/laravel/public/"
<Directory "/home/user/dev/web/laravel/public/">
Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride All
Require all granted
</Directory>
Also, I wrote the following .htaccess
Options -MultiViews
RewriteEngine On
RewriteRule ^(.*)/$ / [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/laravel/(.*) /laravel/index.php/ [L]
Now, when I'm visiting the http://IP/laravel , the index.php is loaded as expected. But if I'm gonna make a call to a GET Route like http://IP/laravel/load_examples I'm getting back a NOT FOUND error.
Instead, if I visit the http://IP/laravel/index.php/load_examples, route loaded as expected.
It seems to me that something's going wrong with the .htaccess and rewrite rules.
I tried everything I found on the SO and other places but couldn't find any solution so far.
Any idea?
Please or to participate in this conversation.