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

orj's avatar
Level 3

Shared hosting htaccess problem

Got this problem since last week i can only access the index page of my website when i try to access the other pages it displays Whoops, looks like something went wrong. even i already change the debug to true. I have my htacess in my public folder

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

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

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

0 likes
12 replies
orj's avatar
Level 3

@Snapey here is the last line in my error log

PHP Warning:  file_get_contents(/home/privateusername/projectname/bootstrap/../.env): failed to open stream: No such file or directory in /home/privateusername/projectname/bootstrap/environment.php on line 15
Snapey's avatar

so is that path correct for your .env file? Is .env present?

JackD's avatar

yes the environment.php is present in my bootstrap folder

bashy's avatar

Have you modified any directory paths? Default install?

orj's avatar
Level 3

i move out the public folder contents to public_html and the rest are inside project_folder

orj's avatar
Level 3

@bashy where can i send you a private message so i can give you the website project url? im not allowed to share it publicly.

regards ciby

bashy's avatar

Well there's your reason I think. It's trying to look for the file in the wrong path. How did you modify the path? In the index.php file?

orj's avatar
Level 3

here's inside my index.php

require __DIR__.'/../projectname/bootstrap/autoload.php';
$app = require_once __DIR__.'/../projectname/bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);

$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);

$response->send();

$kernel->terminate($request, $response);
orj's avatar
Level 3

@bashy am i missing something in my index.php?

here is how my folder structure right now

-> /
-->projectname
-->public_html
-->www
bashy's avatar

Not sure why you've done that but I can't help with customised directories. Try and use symlinks instead, far more dynamic and controllable.

Snapey's avatar

yes the environment.php is present in my bootstrap folder

I was asking about the location of you .env file

Please or to participate in this conversation.