I just transfered my website from one server to one.com. Now nothing works anymore cuz apparently one.com wants the index.php in the root directory but my index.php is in the "web" directory.
I tried to add this to the htaccess: https://help.one.com/hc/en-us/articles/115005586229-How-can-I-change-the-default-start-page-
It loads the website but all the other links to css, js, fonts, icons are messed up. Also all the URLs have /web/ in between them. It looks like the webroot start path should be changed to the "/web" directory instead of just the root "/" like it was on the other server, but one.com doesn't allow that so far that I know of.
Here is a snippet how my index.php files looks like in de /web directory
<?php
/**
* Craft web bootstrap file
*/
// Set path constants
define('CRAFT_BASE_PATH', dirname(__DIR__));
define('CRAFT_VENDOR_PATH', CRAFT_BASE_PATH.'/vendor');
// Load Composer's autoloader
require_once CRAFT_VENDOR_PATH.'/autoload.php';
// Load dotenv?
if (class_exists('Dotenv\Dotenv') && file_exists(CRAFT_BASE_PATH.'/.env')) {
Dotenv\Dotenv::create(CRAFT_BASE_PATH)->load();
}
// Load and run Craft
define('CRAFT_ENVIRONMENT', getenv('ENVIRONMENT') ?: 'production');
/** @var craft\web\Application $app */
$app = require CRAFT_VENDOR_PATH.'/craftcms/cms/bootstrap/web.php';
$app->run();
I also tried to change
define('CRAFT_BASE_PATH', dirname(__DIR__));
to
define('CRAFT_BASE_PATH', __DIR__);
and it removed the /web in the url but no css or js is loaded. (they are bundled from resources by webpack into the web/assets/ directory).
The console gave me in this case this error:
It there another solution on the CraftCMS side to fix this problem to make everything work again like before?
Thanks for in advance!