Importing wp site from cpanel that uses a subfolder

so a cpanel backup was imported and it has a WordPress website that lives in a subfolder, like:

public_html/wp27/ (name has been altered)

It worked fine on the cpanel server but fails to redirect requests and produces 403 because of not having a valid index page in the root folder, apparently.

Gemini suggests there is a catch22 of apache and/or nginx expecting an index at public_html and stopping when it doesn’t find one before processing the .htaccess

But if I put a dummy index.php or w/e at public_html, then that satisfies the first check in .htaccess for index.php and doesn’t process the lower part that would redirect to the subfolder.

I’m not sure how it worked correctly in cPanel but fails to work here. Anyone know what is going on and how to resolve? I’d like it to work as before and not expose the subfolder name in the URL either. Thank you!

DirectoryIndex index.php index.htm index.html

Options -Indexes +FollowSymLinks

BEGIN WordPress

The directives (lines) between “BEGIN WordPress” and “END WordPress” are

dynamically generated, and should only be modified via WordPress filters.

Any changes to the directives between these markers will be overwritten.

<IfModule mod_rewrite.c>
RewriteEngine On
SetEnv MOD_REWRITE_ON Yes
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp27/index.php [L]
</IfModule>

END WordPress

Gemini suggested doing this in the .htaccess:

#RewriteRule ^index\.php$ - [L]
RewriteRule ^index\.php$ /wp27/index.php [L]

and… i guess that seems to have fixed it… after updating all the plugins and themes and stuff… going to different pages just shows the page in the browser after the domain as it should… maybe I am good now.

Remove that rewrite rule and edit the web domain in Hestia. In Advanced options, enable Custom document root, then in Directory enter wp27 and click Save.