skip to Main Content

I have deployed an application to an apache server and it works fine, well only the homepage. As soon as I try to go to a route I get the Not found error in my request log I see GET /users 404

My virtual host file:

<VirtualHost *:80>
    SetEnv ENVPHP acc
    ServerName someurlblabla.com

    DocumentRoot "/var/www/html/projectname/public"
    <Directory "/var/www/html/projectname/public">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from All
    </Directory>    
</VirtualHost>

The .htaccess file is just the default laravel one with apache being able to access and read it.

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # 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}]
</IfModule>

I’m a bit lost since I don’t get any errors in my log and I have no idea what is going on.

2

Answers


  1. what’s about this:

    <VirtualHost *:80>
        SetEnv ENVPHP acc
        ServerName someurlblabla.com
    
        DocumentRoot "/var/www/html/projectname/public"
        <Directory "/var/www/html/projectname">
            Options Indexes FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from All
        </Directory>    
    </VirtualHost>
    
    
    Login or Signup to reply.
  2. Probably you don’t wanna hear this, but switching to Nginx will solve a lot of these problems , and your site will run faster. That’s why Laravel Valet uses Nginx.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search