Answers.Body: <p>You should not be placing Craft at the root of your server, ideally you would place it one level above the <em>Web Root</em> directory, i.e. the one your domain name resolves to.</p>
  
  <p>So, depending on your server OS you would need something like <code>var/www/example.com/craft/</code> and <code>var/www/example.com/www/</code> where <code>var/www/example.com/www/</code> is the Web Root.</p>
  
  <p>Just to add, this is the structure Craft is configured to expect, out-of-the-box, but with the publicly acceesible folder being <code>public_html/</code> rather than <code>www/</code>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-23T12:42:38.843Z
Answers.Text: [craft] is above web root, [www] is the web root
Answers.UserDisplayName: laurent
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-23T12:49:50.020Z
Answers.Text: In that case it should work fine. Have you made changes to .htaccess?
Answers.UserDisplayName: Seth Warburton
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-23T12:50:57.290Z
Answers.Text: Full server path needed to be included in place or the magic _ _ DIR _ _ constant in index.php
Answers.UserDisplayName: laurent
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-23T12:53:13.173Z
Answers.Text: It _could_ work with craft2, but craft 3 has a different folder structure . Thanks for helping anyway
Answers.UserDisplayName: laurent
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-23T12:30:47.357Z
Answers.LastActivityDate: 2018-04-23T12:30:47.357Z
Answers.UserDisplayName: Seth Warburton
Answers.Body: <p>You have to define the path to Craft in your <code>www/index.php</code> file.</p>
  
  <pre><code>define('CRAFT_BASE_PATH', __DIR__ . '/../craft/' ); // &lt;- in your case something like this
  </code></pre>
  
  <p>The constant <code>CRAFT_BASE_PATH</code> must point to your <code>/craft</code> folder     </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-23T12:48:52.250Z
Answers.Text: Your code does NOT work btw, but I replaced _ _ DIR _ _ with the full server path for the craft folder and it does the trick
Answers.UserDisplayName: laurent
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-23T12:23:55.900Z
Answers.LastActivityDate: 2018-04-23T12:23:55.900Z
Answers.UserDisplayName: Robin Schambach
Body: <p>I can't have a mess of craft stuff at the root of my server so I try to use the following directory structure, with craft files and folders gathered in a craft directory :</p>
  
  <pre><code>craft
  -- config
  -- modules
  -- storage
  -- vendor
  -- etc...
  www
  -- index.php
  -- web.config
  -- etc.
  </code></pre>
  
  <p>This structure gives me a 500 error.
  I assume I can change a path variable somewhere, but I just can't find where. Any ideas ?</p>
  
Tags: <craft3>
Title: What changes are needed if I change directory structure?
ThreadText: # What changes are needed if I change directory structure?
  
  (Asked by: username_0 on 2018-04-23)
  
  I can't have a mess of craft stuff at the root of my server so I try to use the following directory structure, with craft files and folders gathered in a craft directory :
  
  ```
  craft
  -- config
  -- modules
  -- storage
  -- vendor
  -- etc...
  www
  -- index.php
  -- web.config
  -- etc.
  
  ```
  
  This structure gives me a 500 error.
  I assume I can change a path variable somewhere, but I just can't find where. Any ideas ?
  
  **Tags:** craft3
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-04-23. Score: 1
  
  You should not be placing Craft at the root of your server, ideally you would place it one level above the *Web Root* directory, i.e. the one your domain name resolves to.
  
  So, depending on your server OS you would need something like `var/www/example.com/craft/` and `var/www/example.com/www/` where `var/www/example.com/www/` is the Web Root.
  
  Just to add, this is the structure Craft is configured to expect, out-of-the-box, but with the publicly acceesible folder being `public_html/` rather than `www/`.
  
  > **Comments:**
  > **username_0**: [craft] is above web root, [www] is the web root  
  > **username_1**: In that case it should work fine. Have you made changes to .htaccess?  
  > **username_0**: Full server path needed to be included in place or the magic _ _ DIR _ _ constant in index.php  
  > **username_0**: It _could_ work with craft2, but craft 3 has a different folder structure . Thanks for helping anyway  
  
  ---
  
  ### Answer by username_2 on 2018-04-23. Score: 1
  
  You have to define the path to Craft in your `www/index.php` file.
  
  ```
  define('CRAFT_BASE_PATH', __DIR__ . '/../craft/' ); // <- in your case something like this
  
  ```
  
  The constant `CRAFT_BASE_PATH` must point to your `/craft` folder
  
  > **Comments:**
  > **username_0**: Your code does NOT work btw, but I replaced _ _ DIR _ _ with the full server path for the craft folder and it does the trick  
  
  ---
  
  