Body: <p>On most shared hosting, you can't set the webroot. As an alternative, a rewriterule to the web folder can do this.
  Could be something like <code>RewriteRule ^(.*)$ web/$1 [L]</code>.</p>
  
  <p>This works on main sites in Craft 3, but breaks subsites.</p>
  
  <p><a href="https://github.com/craftcms/cms/issues/2221#issuecomment-352440927" rel="nofollow noreferrer">I've found an answer from Brandon Kelly</a>, suggesting to use different indexes.php and loading the correct one via the htaccess. (based on subsite prefix)</p>
  
  <p>Is there a better solution since this date, that might prevent the need for different indexes?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-06-25T15:44:28.630Z
Comments.Text: What problem are you trying to solve, exactly? You can just rename the `web` folder to be whatever it is on your shared hosting.
Comments.UserDisplayName: Lindsey D
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-06-26T06:53:29.117Z
Comments.Text: Currently, everything is placed in the webfolder and the htaccess is used to reroute all traffic to the web folder. This works, but causes subsites to return as 404.
  
  Is there a way to fix the rewrite for this? Or should I look into adding everything one folder above the webroot and rename the web folder?
Comments.UserDisplayName: Bert H
Tags: <craft3><multi-site>
Title: Subsites not found when running Craft 3 on shared hosting
ThreadText: # Subsites not found when running Craft 3 on shared hosting
  
  (Asked by: username_0 on 2019-06-25)
  
  On most shared hosting, you can't set the webroot. As an alternative, a rewriterule to the web folder can do this.
  Could be something like `RewriteRule ^(.*)$ web/$1 [L]`.
  
  This works on main sites in Craft 3, but breaks subsites.
  
  [I've found an answer from Brandon Kelly](https://github.com/craftcms/cms/issues/2221#issuecomment-352440927), suggesting to use different indexes.php and loading the correct one via the htaccess. (based on subsite prefix)
  
  Is there a better solution since this date, that might prevent the need for different indexes?
  
  **Tags:** craft3, multi-site
  
  > **Comments:**
  > **username_1**: What problem are you trying to solve, exactly? You can just rename the `web` folder to be whatever it is on your shared hosting.  
  > **username_0**: Currently, everything is placed in the webfolder and the htaccess is used to reroute all traffic to the web folder. This works, but causes subsites to return as 404.  Is there a way to fix the rewrite for this? Or should I look into adding everything one folder above the webroot and rename the web folder?  
  
  ---
  
  ## 0 answers
  
  