Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jack100's avatar

Laravel Boilerplate on Hosting Server: error -> public/login was not found on this server.

Hi, I need your help. I searched now for ages on the net to find a solution, but without success.

I have installed the boilerplate of Laravel: https://github.com/Labs64/laravel-boilerplate/issues

Everything fine no issues at all. I see the hompage from Laravel. When I click on login, register etc. I get an error like: The requested URL /laravel-boilerplate/public/login was not found on this server

I am using apache, debian. Rewrite module is activated.

I guess it must be something with the .htaccess or conf of Apache.

This URL works surprisingly: ..../laravel-boilerplate/public/index.php/login

.htaccess in /laravel-boilerplate/public/

Options +FollowSymLinks
 RewriteEngine On

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

conf of apache

<VirtualHost *:80>

    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/laravel-boilerplate/public

    <Directory /var/www/laravel-boilerplate/public>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted

        RewriteEngine On
        RewriteBase /var/www/laravel-boilerplate/public
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Thank you in advance.

0 likes
3 replies
latz's avatar

Perhaps the RewriteBase is not correct. Try a comment out.

Snapey's avatar
Snapey
Best Answer
Level 122

it's because you must set public as the document root

2 likes
jack100's avatar

Thank you so much, Snapey.

This was the right tip. The default conf of apache had still the DocumentRoot set. I removed the files and restarted.

Now it works.

Please or to participate in this conversation.