Body: <p>I'm building a Craft site locally and I'm unsure how to handle a path issue that will occur when the site goes live.</p>
  <p>My understanding is that in a live implementation, the /web/ folder will become the root folder.  In twig templates, I can exclude /web/ from paths by using {{ siteURL }}, i.e. {{ siteURL }}images/.</p>
  <p>However, you can't use Twig when adding page content through Redactor.  So if I want to include an image with the page text, I have to use &quot;/web/&quot; in the path.  When the site goes live, those paths will be broken since the /web/ folder will become the root.</p>
  <p>How can I resolve this without having to change all the links to remove /web/ once the site is live? I feel like there must be a configuration file or setting somewhere I can change, but I haven't been able to find one.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-04T20:17:05.883Z
Comments.Text: How do you develop locally? 
  
  Normally you also have a webserver (e.g. MAMP Pro or some Vagrant or the hot new Nitro thing) running locally which is using the /web/ folder as docRoot. So it should behave exactly the same way as on the live system.
Comments.UserDisplayName: Matthias Redl-Mann
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-05T15:23:08.633Z
Comments.Text: Ahh, I wasn't even thinking about it being an issue with the webserver settings, I was thinking it was a configuration issue somewhere in Craft. I set the wrong root directory when I created the virtual host in MAMP. Thanks!
Comments.UserDisplayName: Jake1293
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-07T01:13:17.807Z
Comments.Text: Maybe use `@web` alias and the pass output of redactor field through `{{alias()}}` function? Thanks to that, `@web` will be always resolved as root url.
Comments.UserDisplayName: Piotr Pogorzelski
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-07T20:09:58.573Z
Comments.Text: Thanks for the suggestion, I'll look into that for future use. I ended up solving this issue by editing my .env file and removing "web" from the site root path. This was my first Craft site so I didn't understand at the time I set it up that the /web/ folder should be the root, not the project folder.
Comments.UserDisplayName: Jake1293
Tags: <siteurl>
Title: Path issue when developing locally - /web/ folder
ThreadText: # Path issue when developing locally - /web/ folder
  
  (Asked by: username_0 on 2020-07-03)
  
  I'm building a Craft site locally and I'm unsure how to handle a path issue that will occur when the site goes live.
  
  My understanding is that in a live implementation, the /web/ folder will become the root folder. In twig templates, I can exclude /web/ from paths by using {{ siteURL }}, i.e. {{ siteURL }}images/.
  
  However, you can't use Twig when adding page content through Redactor. So if I want to include an image with the page text, I have to use "/web/" in the path. When the site goes live, those paths will be broken since the /web/ folder will become the root.
  
  How can I resolve this without having to change all the links to remove /web/ once the site is live? I feel like there must be a configuration file or setting somewhere I can change, but I haven't been able to find one.
  
  **Tags:** siteurl
  
  > **Comments:**
  > **username_1**: How do you develop locally?   Normally you also have a webserver (e.g. MAMP Pro or some Vagrant or the hot new Nitro thing) running locally which is using the /web/ folder as docRoot. So it should behave exactly the same way as on the live system.  
  > **username_0**: Ahh, I wasn't even thinking about it being an issue with the webserver settings, I was thinking it was a configuration issue somewhere in Craft. I set the wrong root directory when I created the virtual host in MAMP. Thanks!  
  > **username_2**: Maybe use `@web` alias and the pass output of redactor field through `{{alias()}}` function? Thanks to that, `@web` will be always resolved as root url.  
  > **username_0**: Thanks for the suggestion, I'll look into that for future use. I ended up solving this issue by editing my .env file and removing "web" from the site root path. This was my first Craft site so I didn't understand at the time I set it up that the /web/ folder should be the root, not the project folder.  
  
  ---
  
  ## 0 answers
  
  