Router not working on production server

Hi everyone

I've an annoying issue. I have a prefix route => and when I go to this link it shows me the application. But If I want to go to this link => then I have a 404 error.

I can't figure it out, does anyone know how to solve this?


 Route::get('/contact', function() {
     return "hallo";


<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
RewriteEngine On
RewriteBase /app/

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]


location /app {
        alias /folder/to/laravel/public;
        index index.php index.html index.htm;

            location ~ \.php$ {
                include ./fastcgi.conf;
                fastcgi_param SCRIPT_FILENAME $request_filename;

     # try_files $uri $uri/ /index.php;


henrik-nordstrom replied 1 year ago

Try removing the leading slash:

 Route::get('contact', function() {
     return "hallo";
yawuar replied 1 year ago

It still returns a 404 error page.

Sign in to participate in this thread!

We'd like to thank these amazing companies for supporting us