Hello,
I don't know if this will help you, but I see that you write
htacess
instead of
.htaccess
Good luck.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
For the testing of a new version of a project, i have to deploy a laravel project to a subfolder wich was set up for me. I already programmed it on the localhost and only need to upload it.
The subdomain is on example.com/new
The structure i found in Filezilla was like this: (i do not have acess/can't see to the main Versions files-does this mean it is a subdomain?)
htacess
env
newProject(folder)
public
I did not have permission to upload new files above the public folder. The .env and .htacess could be replaced. So i did the following
htacess
env
newProject(folder)
public
index
project(folder) (laravel put another.env and .htacess in here are these the right ones to change)
.htacess
.env
rest of laravel files
Out of confusion i always just make a change in both existing .env's and .htacess because i don't know wich is the right one. Is this setup right? I already changed the index
require DIR.'/project/vendor/autoload.php';
$app = require_once DIR.'/project/bootstrap/app.php';
My htacess:
Options -MultiViews -IndexesRewriteEngine On
[[rewritebase /new
# 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]
MY PROBLEM: There is at least something working. Because i have an automatic rerouting for languages in the web.php
Route::redirect('/', '/en'); Route::group(['prefix' => '{language}', ''], function (){ ...routes
And when i go to example.com/new it reroutes me to example.com/en instead of example.com/new/en. That means it does come to the routing part, dies this mean htacess and .env are set up right?
the error is of course
"Not Found The requested URL was not found on this server."
MY QUESTION
How do i stop the rerouting to /en and go to /new/en. Is there a prefix i can add to all my routes. And can i be sure the rest is set up right just because the code routes to /en wich is set up in the web.php?
Please or to participate in this conversation.