Redirect Issue on Strato

Hi there. I have a problem with my Setup.

Im running Cockpit with some Custom HTML/CSS for the Frontend where I just fetch the content from the Backend my structure is like this:

/cockpit/frontend

as soon as I use the strato redirect to my frontend folder i cant access cockpit admin anymore and my fetch operation from /frontend/js/main.js also wont work correctly anymore.

Is there a proper way to do it via .htaccess or anything?

Might seem like a dumb question but I am merely a coder more on the design side and happy to got my project going to this point. It is actually the last thing what hinders me from going live.

Thank you in advance and best regards,
cheers

I’m not sure, if I understood your setup correctly…

Do you fetch the data via REST API or do you include the cockpit bootstrap file via php?

Did you setup everything under example.com/cockpit, tested everything on example.com/cockpit/frontend and then changed example.com to point to /cockpit/frontend? In this case, cockpit is not public available anymore, but you should be able to include the bootstrap file.

Maybe with setting RewriteBase, but I have a setup on strato, where I didn’t need to change it.

You can change some constants for path detection if you add a file defines.php to the cockpit root folder.

I use the structure /frontend/cockpit, so the setup is a bit different, but maybe you can fiddle with it. Here are some threads with examples for the defines file:

I also found my self in massive troubles with strato.

One thing that often helped me out when using cockpit on strato hosting packages is putting this at the beginning of the index.php file of cockpit:

$_SERVER['DOCUMENT_ROOT'] = rtrim($_SERVER['PHPRC'], DIRECTORY_SEPARATOR);

But I never tried to put cockpit into a sub dir of my webpage instance while using strato as hosting-provider; so I don’t know if this will actually help in any way.