Very new to craft CMS, recently just installed XAMPP with php 7 and craft 3 and followed the getting started tutorial from Craft CMS. Then when I try to preview or open the page created from the tutorial, it gives me a 404 template not found error.
The error is as follows:
yii\web\NotFoundHttpException: Template not found: $PRIMARY_SITE_URL/$PRIMARY_SITE_URL/blog/this-is-my-blog in C:\xampp\htdocs\craft\vendor\craftcms\cms\src\controllers\TemplatesController.php:92
Stack trace:
#0 [internal function]: craft\controllers\TemplatesController->actionRender('$PRIMARY_SITE_U...', Array)
#1 C:\xampp\htdocs\craft\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)
#2 C:\xampp\htdocs\craft\vendor\yiisoft\yii2\base\Controller.php(181): yii\base\InlineAction->runWithParams(Array)
#3 C:\xampp\htdocs\craft\vendor\craftcms\cms\src\web\Controller.php(190): yii\base\Controller->runAction('render', Array)
#4 C:\xampp\htdocs\craft\vendor\yiisoft\yii2\base\Module.php(534): craft\web\Controller->runAction('render', Array)
#5 C:\xampp\htdocs\craft\vendor\craftcms\cms\src\web\Application.php(274): yii\base\Module->runAction('templates/rende...', Array)
#6 C:\xampp\htdocs\craft\vendor\yiisoft\yii2\web\Application.php(104): craft\web\Application->runAction('templates/rende...', Array)
#7 C:\xampp\htdocs\craft\vendor\craftcms\cms\src\web\Application.php(259): yii\web\Application->handleRequest(Object(craft\web\Request))
#8 C:\xampp\htdocs\craft\vendor\yiisoft\yii2\base\Application.php(392): craft\web\Application->handleRequest(Object(craft\web\Request))
#9 C:\xampp\htdocs\craft\web\index.php(23): yii\base\Application->run()
#10 {main}
I have followed all the instructions in the tutorial, and have created the _entry.twig in my templates/blog folder. Any help would be much appreciated
PRIMARY_SITE_URL
key in your.env
file? For example, your .env file might havePRIMARY_SITE_URL="http://example.test"
PRIMARY_SITE_URL=localhost
?