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

Wakanda's avatar
Level 10

.htaccess go back to the previous directory

Hi Devs,

How can I go back to the previous directory using the .htaccess configuration?

RewriteRule ^(.*)$ public/ [L]

The above code instructs to go to the public directory but what I want to do is to a previous directory then another directory then public.

What I have tried so far

RewriteRule ^(.*)$ ../WebApp/public/ [L]

it seems not to be working

0 likes
1 reply
Snapey's avatar

just focus on serving the correct folder in the first place

Please or to participate in this conversation.