Body: <pre><code>HTTP 404 – Not Found – yii\web\NotFoundHttpException
  Template not found: $DEFAULT_SITE_URL
  1. in /Users/brenbauer/morphd/craft3/vendor/craftcms/cms/src/controllers/TemplatesController.php at line 90
  81828384858687888990919293949596979899    {
          // Does that template exist?
          if (
              (
                  Craft::$app-&gt;getConfig()-&gt;getGeneral()-&gt;headlessMode &amp;&amp;
                  Craft::$app-&gt;getRequest()-&gt;getIsSiteRequest()
              ) ||
              !$this-&gt;getView()-&gt;doesTemplateExist($template)
          ) {
              throw new NotFoundHttpException('Template not found: ' . $template);
          }
   
          // Merge any additional route params
          $routeParams = Craft::$app-&gt;getUrlManager()-&gt;getRouteParams();
          unset($routeParams['template'], $routeParams['template']);
          $variables = array_merge($variables, $routeParams);
   
          return $this-&gt;renderTemplate($template, $variables);
      }
  2. craft\controllers\TemplatesController::actionRender('$DEFAULT_SITE_URL', [])
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-25T21:27:56.657Z
Comments.Text: How do you have the `$DEFAULT_SITE_URL` environment variable defined and setup in Craft?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-28T16:38:51.080Z
Comments.Text: I was able to get this resolved; thank you, Brad.
Comments.UserDisplayName: Bren Bauer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-09-25T10:15:37.200Z
Comments.Text: Can you upload the answer and mark it as solved @BrenBauer?
Comments.UserDisplayName: darylknight
Tags: <404>
Title: I set up a local environment. I can log in, but if I select the site icon or preview I get a 404 message
ThreadText: # I set up a local environment. I can log in, but if I select the site icon or preview I get a 404 message
  
  (Asked by: username_0 on 2020-06-25)
  
  ```
  HTTP 404 – Not Found – yii\web\NotFoundHttpException
  Template not found: $DEFAULT_SITE_URL
  1. in /Users/username_0/morphd/craft3/vendor/craftcms/cms/src/controllers/TemplatesController.php at line 90
  81828384858687888990919293949596979899    {
          // Does that template exist?
          if (
              (
                  Craft::$app->getConfig()->getGeneral()->headlessMode &&
                  Craft::$app->getRequest()->getIsSiteRequest()
              ) ||
              !$this->getView()->doesTemplateExist($template)
          ) {
              throw new NotFoundHttpException('Template not found: ' . $template);
          }
   
          // Merge any additional route params
          $routeParams = Craft::$app->getUrlManager()->getRouteParams();
          unset($routeParams['template'], $routeParams['template']);
          $variables = array_merge($variables, $routeParams);
   
          return $this->renderTemplate($template, $variables);
      }
  2. craft\controllers\TemplatesController::actionRender('$DEFAULT_SITE_URL', [])
  
  ```
  
  **Tags:** 404
  
  > **Comments:**
  > **username_1**: How do you have the `$DEFAULT_SITE_URL` environment variable defined and setup in Craft?  
  > **username_0**: I was able to get this resolved; thank you, username_1.  
  > **username_2**: Can you upload the answer and mark it as solved @username_0?  
  
  ---
  
  ## 0 answers
  
  