1

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.

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
| improve this answer | |
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.

| improve this answer | |
0

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!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.