<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>

CC BY-SA 4.0
2019-06-25T15:44:28.630Z
What problem are you trying to solve, exactly? You can just rename the `web` folder to be whatever it is on your shared hosting.
Lindsey D
CC BY-SA 4.0
2019-06-26T06:53:29.117Z
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?
Bert H
<craft3><multi-site>
Subsites not found when running Craft 3 on shared hosting
# 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

