I collected a few defines from tests on different hosts before. Maybe, there is one for you. If you nest your cockpit deeper, you may adjust some paths to something like basename(basename(__DIR__))
…
Setup (I used PHP and not the API, but I tested the API for the forms endpoint):
- cockpit/... --> Backend
- index.php --> Frontend
- .htaccess
- ...
strato (shared host):
subdomain points to /dir
Frontend:
define('BASE_URL', '/' . basename(__DIR__));
define('BASE_ROUTE', '/' . basename(__DIR__));
$options['route'] = preg_replace('#'.preg_quote(BASE_URL, '#').'#', '', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), 1);
Backend:
define('COCKPIT_BASE_URL', '/' . basename(__DIR__));
define('COCKPIT_BASE_ROUTE', '/' . basename(__DIR__));
define('COCKPIT_DOCS_ROOT', dirname(__DIR__));
Uberspace6, Uberspace7 (shared host)
works out of the box if using var/www/virtual/$USER/html
If using subomain var/www/virtual/$USER/blog.example.com
:
Frontend: .htaccess
needs RewriteBase /
Backend: .htaccess
needs RewriteBase /cockpit