<p>Thanks for your help. As it turns out, I was able to move all of the "web" files into my htdocs root directory, however the update I made to my index.php to reference the new base path was not working as expected. I was referencing another stackexchange post that said to do it this way: </p>

<p><code>define('CRAFT_BASE_PATH', dirname(__DIR__).'/cms');</code></p>

<p>^ this format was throwing an error each time. But it works when I switched to using this format instead: </p>

<p><code>define('CRAFT_BASE_PATH', __DIR__.'/cms');</code></p>

<p>Likely just an obvious thing that went over my head, but happy to say it worked!</p>

CC BY-SA 4.0
2019-01-14T18:12:02.040Z
2019-01-14T18:12:02.040Z
Kane
<p>Sounds like you need to move everything up one level...</p>

<pre><code>/opt/bitnami/apache2/cms/ (if you can)
/opt/bitnami/apache2/htdocs/
</code></pre>

<p>The <code>web</code> folder can be renamed to <code>htdocs</code> (or anything, really) and it will work normally.</p>

<p>If you can't get above <code>htdocs</code>, you'll want to do it like this...</p>

<pre><code>/opt/bitnami/apache2/htdocs/cms/
/opt/bitnami/apache2/htdocs/index.php
/opt/bitnami/apache2/htdocs/cpresources
/opt/bitnami/apache2/htdocs/.htaccess
</code></pre>

CC BY-SA 4.0
2019-01-11T22:30:16.503Z
2019-01-11T22:30:16.503Z
Lindsey D
<p>It should be possible to point the server at the <code>/web</code> directory, then specify the path to Craft's files in <code>index.php</code> by setting the <code>CRAFT_BASE_PATH</code> value. You probably already read it, but just in case not: <a href="https://craftcms.com/guides/moving-craft-files" rel="nofollow noreferrer">https://craftcms.com/guides/moving-craft-files</a>. If that's not the problem, there might be file permissions issues.</p>

CC BY-SA 4.0
2019-01-11T22:46:53.220Z
2019-01-11T22:46:53.220Z
Sam Hernandez
<p>try running <code>php -S localhost:8000 -t web</code> on the project directory</p>

CC BY-SA 4.0
2022-01-10T06:34:33.653Z
2022-01-10T06:34:33.653Z
Chris John Mulingbayan
<p>I have been all over the docs page and various other topics across the web on this, and nothing seems to solve it for me. It's probably something obvious, but I am stuck. I recently installed Craft 3 on an Amazon Lightsail LAMP server. My file structure is like this:</p>

<p>/opt/bitnami/apache2/<strong>htdocs</strong>/ (My root folder)</p>

<p>Inside that root folder, I have this structure: </p>

<ul>
<li><strong>cms</strong> (contains all of the Craft installation files)</li>
<li><strong>web</strong> (contains index.php, cpresources,.htaccess)</li>
</ul>

<p>When I load my site at www.example.com, I arrive at a page that just shows my file structure. Only when I click into the web folder (www.example.com/web), does my initial page of my site load up. I want that page to load up without showing "web" in the URL. I have tried the following things with no success:</p>

<ol>
<li>Changing the Base URL</li>
<li>Changing my httppd.conf file to point to "web" as the root</li>
<li>Moving all of the files inside the web folder into my root folder (htdocs)</li>
</ol>

<p>And a few other random things. I really am having a hard time pinpointing this exact issue in any of the documentation. Looking for any advice anybody can offer. </p>

<url>
How do I get rid of "web" in URL?
# How do I get rid of "web" in URL?

(Asked by: username_0 on 2019-01-11)

I have been all over the docs page and various other topics across the web on this, and nothing seems to solve it for me. It's probably something obvious, but I am stuck. I recently installed Craft 3 on an Amazon Lightsail LAMP server. My file structure is like this:

/opt/bitnami/apache2/**htdocs**/ (My root folder)

Inside that root folder, I have this structure:

* **cms** (contains all of the Craft installation files)
* **web** (contains index.php, cpresources,.htaccess)

When I load my site at www.example.com, I arrive at a page that just shows my file structure. Only when I click into the web folder (www.example.com/web), does my initial page of my site load up. I want that page to load up without showing "web" in the URL. I have tried the following things with no success:

1. Changing the Base URL
2. Changing my httppd.conf file to point to "web" as the root
3. Moving all of the files inside the web folder into my root folder (htdocs)

And a few other random things. I really am having a hard time pinpointing this exact issue in any of the documentation. Looking for any advice anybody can offer.

**Tags:** url

---

## 4 answers

### Answer by username_0 on 2019-01-14. Score: 1 | Accepted answer

Thanks for your help. As it turns out, I was able to move all of the "web" files into my htdocs root directory, however the update I made to my index.php to reference the new base path was not working as expected. I was referencing another stackexchange post that said to do it this way:

`define('CRAFT_BASE_PATH', dirname(__DIR__).'/cms');`

^ this format was throwing an error each time. But it works when I switched to using this format instead:

`define('CRAFT_BASE_PATH', __DIR__.'/cms');`

Likely just an obvious thing that went over my head, but happy to say it worked!


---

### Answer by username_1 on 2019-01-11. Score: 1

Sounds like you need to move everything up one level...
/opt/bitnami/apache2/cms/ (if you can)
/opt/bitnami/apache2/htdocs/

The web folder can be renamed to htdocs (or anything, really) and it will work normally.
If you can't get above htdocs, you'll want to do it like this...
/opt/bitnami/apache2/htdocs/cms/
/opt/bitnami/apache2/htdocs/index.php
/opt/bitnami/apache2/htdocs/cpresources
/opt/bitnami/apache2/htdocs/.htaccess


---

### Answer by username_2 on 2019-01-11. Score: 1

It should be possible to point the server at the `/web` directory, then specify the path to Craft's files in `index.php` by setting the `CRAFT_BASE_PATH` value. You probably already read it, but just in case not: <https://craftcms.com/guides/moving-craft-files>. If that's not the problem, there might be file permissions issues.


---

### Answer by username_3 on 2022-01-10. Score: 0

try running `php -S localhost:8000 -t web` on the project directory


---

