You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With version 11 TYPO3 changed the URL rewriting which breaks Valet. Valet routes always to the frontend even if you open the backend at https://example.com/typo3. The error is: "The page did not exist or was inaccessible. Reason: No site configuration found."
I got it running by adjusting the Nginx configuration and the TYPO3ValetDriver. I added a LocalValetDriver and made the changes there. Here are the two files:
<?phpdeclare(strict_types=1);
useValet\Drivers\LaravelValetDriver;
class LocalValetDriver extends Typo3ValetDriver
{
protected$documentRoot = '/public';
/** * Determine if the driver serves the request. */publicfunctionserves($sitePath, $siteName, $uri)
{
returntrue;
}
/** * Get the fully resolved path to the application's front controller. */publicfunctionfrontControllerPath($sitePath, $siteName, $uri)
{
// without modifying the URI, redirect if necessary$this->handleRedirectBackendShorthandUris($uri);
// from now on, remove trailing / for convenience for all the following join operations$uri = rtrim($uri, '/');
if (file_exists($absoluteFilePath = $sitePath.$this->documentRoot.$uri)) {
if (is_dir($absoluteFilePath)) {
if (file_exists($absoluteFilePath.'/index.php')) {
// this folder can be served by index.phpreturn$this->serveScript($sitePath, $siteName, $uri.'/index.php');
}
if (file_exists($absoluteFilePath.'/index.html')) {
// this folder can be served by index.htmlreturn$absoluteFilePath.'/index.html';
}
} elseif (pathinfo($absoluteFilePath, PATHINFO_EXTENSION) === 'php') {
// this file can be served directlyreturn$this->serveScript($sitePath, $siteName, $uri);
}
} elseif(str_contains($uri, '/typo3/')) {
return$this->serveScript($sitePath, $siteName, '/typo3/index.php'); // basically added this line to route requests to the backend to the right file.
}
return$this->serveScript($sitePath, $siteName, '/index.php');
}
privatefunctionhandleRedirectBackendShorthandUris($uri)
{
if (rtrim($uri, '/') === '/typo3/install') {
header('Location: /typo3/sysext/install/Start/Install.php');
exit();
}
}
privatefunctionserveScript($sitePath, $siteName, $uri)
{
$docroot = $sitePath.$this->documentRoot;
$abspath = $docroot.$uri;
$_SERVER['SERVER_NAME'] = $siteName.'.dev';
$_SERVER['DOCUMENT_ROOT'] = $docroot;
$_SERVER['DOCUMENT_URI'] = $uri;
$_SERVER['SCRIPT_FILENAME'] = $abspath;
$_SERVER['SCRIPT_NAME'] = $uri;
$_SERVER['PHP_SELF'] = $uri;
return$abspath;
}
}
and change the corresponding Nginx file for the domain to:
As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.
If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.
Description
With version 11 TYPO3 changed the URL rewriting which breaks Valet. Valet routes always to the frontend even if you open the backend at
https://example.com/typo3
. The error is: "The page did not exist or was inaccessible. Reason: No site configuration found."I got it running by adjusting the Nginx configuration and the TYPO3ValetDriver. I added a
LocalValetDriver
and made the changes there. Here are the two files:and change the corresponding Nginx file for the domain to:
Steps To Reproduce
Install a new TYPO3
composer create-project typo3/cms-base-distribution:"^11" example
Link Valet
cd example && valet link example && valet secure
Add a
FIRST_INSTALL
filetouch example/public/FIRST_INSTALL
Go through the installation process and open the backend (https://example.com/typo3) or the frontend (https://example.com).
Diagnosis
Not Needed
The text was updated successfully, but these errors were encountered: