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

madmaxax's avatar

500 Error - Laravel Project Deployment on Shared Hosting

I have difficulty deploying my laravel project on 1and1 managed hosting. And specifically, adjusting the .htaccess so that there is no 500 error when trying to access https://www.muza-store.de

My project structure:

/muza-store
    /public
        .htaccess
        index.php
        php-errors.log
        php.ini
        ...
    /resources
    /routes
    /storage
    .env
    ...

I just changed the project root to the /muza-store -directory. The public-directory as the root didn't work because the other directories and files above the root-directory couldn't be accessed.

This is the content of the .htaccess-file:

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

    RewriteEngine On

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

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

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

Unfortunately, everything I tried didn't work at all.

I would greatly appreciate ideas, tipps and resources to learn more about .htaccess -files.

Thanks a lot!

0 likes
4 replies
skoobi's avatar

In the file structure you have there, in public the index should be the index.php not html. In the index.php it with have the route to the main app

skoobi's avatar

No problem. Did it work? If so mark the best answer.

Cheers

Please or to participate in this conversation.