I’m not 100% sure, but I think COCKPIT_SITE_DIR should point to /htdocs/cms, too. I only had one Cockpit project on a strato host and I used cockpit in a subdirecotry without a sub domain. So example.com/cockpit worked with just defining
<?php
// strato environment, root is in subdir, but domain points to root/subdir
// cockpit is in root/subdir/cockpit
if (!defined('COCKPIT_BASE_URL')) define('COCKPIT_BASE_URL', '/' . basename(__DIR__));
if (!defined('COCKPIT_BASE_ROUTE')) define('COCKPIT_BASE_ROUTE', COCKPIT_BASE_URL);
if (!defined('COCKPIT_DOCS_ROOT')) define('COCKPIT_DOCS_ROOT', dirname(__DIR__));
Maybe you have to set RewriteBase / in .htaccess, too.
See also this thread
Oh, and if you are forced to use strato, don’t forget to add a .htaccess file in your public root directory that denies all or redirects to your main domain. Otherwise customer_id.swh.strato-hosting.eu exposes all files above /htdocs - and you made your customer id public in your screenshot.
Cockpit should work fine without https, but in general it is a big issue
Thanks for the reply and for pointing out the posted id. I edited my post.
Now I pointed COCKPIT_SITE_DIR to /htdocs/cms but it results in the same problem.
I also commented the “RewriteBase” back in in the shipped .htaccess file without success.
Oh, and if you are forced to use strato, don’t forget to add a .htaccess file in your public root directory that denies all or redirects to your main domain
So I need to add the .htacces file to the web page folder, right? For example:
/mnt/web223/b3/49/xxxxxxxx/htdocs/webpage/.htaccess
Maybe I will place cockpit in a subfolder of the webpage if I don´t find a solution. That domain contain a valid SSL certificate as well.
I’m sorry, that it didn’t work. I was able to run it for my use case once and if I ever have to touch strato again, I’ll grab my notes from the last project and try to fiddle with it.
Maybe RewriteBase /cms works…
Or maybe @serjoscha87 has a hint? He mentioned, that his agency has a huge internal strato issue wiki.
No! Strato is ugly, bad, slow and insecure: /mnt/web223/b3/49/xxxxxxxx/htdocs/.htaccess. It looks, like you could store secret files in this directory, because their user interface forces you to point all your domains to sub directories, but their id url exposes that parent directory. Before I posted my last answer, I did a quick test and I was able to access your test setup at customer_id.swh.strato-hosting.eu/cms and id redirected me to customer_id.swh.strato-hosting.eu/auth/login.
Sorry for the flaming, but everytime I worked with this hoster, I had a ton of problems and the easiest solution was to create a dns entry to a different hoster.
did not read all the stuff in this post yet, just saw there is a strato problem (strato s**** in so many aspects - I often had hard times messing around with this s**** provider… )
to the very top of the index.php (located in the document root)
somehow strato sets up the server env vars another way just every other provider does, leading us to some strange problems. This line above should make cockpit being able to deal with the strato env condition.
*edit: I absolute agree with raffaelj and the things he is saying about strato… This provider made me go completely mad… not just once