Step …n…: Moving application and system folder to safety

Created at: November 14, 2014; Last update: January 23, 2015

Once you’ve finished testing the site on the production or test server is time to make sure that you won’t have any surprises from your evil “visitors”. So, try to put the application and system folders in a folder that is not accessible from the web. If you are on a shared server, you should put the index.php in “public_html” folder. After that, create a folder (maybe named “ci”?) on same level as public_html folder.

So, the structure of the files would look something like this:

Now, if you visit your “site” you should see the following error: “Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.php“.

To resolve this issue, go to your public_html/index.php and in there change $system_path to where you moved your system folder. In our case that should be:

Do the same with $application_path:

 

4 thoughts on “Step …n…: Moving application and system folder to safety

  1. MarcoCZen

    Hi , when we do this, what happens to folders like images , css , js that we have ?
    How do we adjust the base url ? Like when we link to bootstrap files in views ?

    Reply
    1. avenirer Post author

      Well… you keep the asset folders inside de public area of your website. And when you call them you simply use site_url():

      Reply
  2. PeterD

    Also – remember to move your .htaccess file into your public directory.
    (really great set of tutorials btw:)

    Reply
  3. Emem

    I tried accessing cashcloud.net and it said Your system folder path does not appear to be set correctly.Has the site been shut down?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

No spam? * Time limit is exhausted. Please reload CAPTCHA.