<p>This knowledge base article on <a href="https://craftcms.com/knowledge-base/moving-craft-files" rel="nofollow noreferrer">moving Craft’s files below the webroot</a> should help you.</p>

CC BY-SA 4.0
2021-01-07T07:12:39.073Z
2021-01-07T07:12:39.073Z
Oli
<p>The easiest way to do this would be to change the domains root directory from ../public_html to ../public_html/web, so that only the &quot;web&quot; directory is accessible from outside. This is also recommendable from a security standpoint.</p>

CC BY-SA 4.0
2021-02-06T14:53:10.603Z
2021-02-06T14:53:10.603Z
MisterMike
<p>I am very new to craft. installed craft3 very long ago, as a beginner, and trying to solve a long-lasted-issue with my url.</p>
<p>my goal:</p>
<ul>
<li>Change my base url from <a href="http://www.mywebsite.com/web" rel="nofollow noreferrer">www.mywebsite.com/web</a> to <a href="http://www.mywebsite.com" rel="nofollow noreferrer">www.mywebsite.com</a></li>
</ul>
<ul>
<li>At the moment <a href="http://www.mywebsite.com" rel="nofollow noreferrer">www.mywebsite.com</a> shows 403 forbidden error.</li>
</ul>
<p>My directory structure looks as below. As you can see, I installed craft only under public_html/mywebsite.com. I cannot move the files in /mywebsite.com into /public_html folder.</p>
<p>I researched and tried to follow <a href="https://craftcms.stackexchange.com/questions/29085/how-do-i-get-rid-of-web-in-url">this article</a> however quiet unsure with the different folder structure I have.
Just in case I moved index.html file to the /mywebsite.com root, and at least forbidden error was gone while only blanc page was loaded.
I had the feeling that I could do something with index.php file to redefine<code>('CRAFT_BASE_PATH', dirname(__DIR__));</code>. However also not sure what to write..</p>
<p>Thanks a lot for your help in advance!
<a href="https://i.sstatic.net/d5L0G.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/d5L0G.png" alt="my directory structure" /></a></p>

<craft3><siteurl>
Craft3 - Getting rid of /web in my URL
# Craft3 - Getting rid of /web in my URL

(Asked by: username_0 on 2021-01-06)

I am very new to craft. installed craft3 very long ago, as a beginner, and trying to solve a long-lasted-issue with my url.

my goal:

* Change my base url from [www.mywebsite.com/web](http://www.mywebsite.com/web) to [www.mywebsite.com](http://www.mywebsite.com)

* At the moment [www.mywebsite.com](http://www.mywebsite.com) shows 403 forbidden error.

My directory structure looks as below. As you can see, I installed craft only under public\_html/mywebsite.com. I cannot move the files in /mywebsite.com into /public\_html folder.

I researched and tried to follow [this article](https://craftcms.stackexchange.com/questions/29085/how-do-i-get-rid-of-web-in-url) however quiet unsure with the different folder structure I have.
Just in case I moved index.html file to the /mywebsite.com root, and at least forbidden error was gone while only blanc page was loaded.
I had the feeling that I could do something with index.php file to redefine`('CRAFT_BASE_PATH', dirname(__DIR__));`. However also not sure what to write..

Thanks a lot for your help in advance!
[![my directory structure](https://i.sstatic.net/d5L0G.png)](https://i.sstatic.net/d5L0G.png)

**Tags:** craft3, siteurl

---

## 2 answers

### Answer by username_1 on 2021-01-07. Score: 1

This knowledge base article on [moving Craft’s files below the webroot](https://craftcms.com/knowledge-base/moving-craft-files) should help you.


---

### Answer by username_2 on 2021-02-06. Score: 1

The easiest way to do this would be to change the domains root directory from ../public\_html to ../public\_html/web, so that only the "web" directory is accessible from outside. This is also recommendable from a security standpoint.


---

