I want to upload code igniter folder to remote server. Should I upload codeigniter root folder to my public_html folder so I got following structure
public_html/
codeigniter/
application/
system/
....
or should I upload application system ... directly to my public_html
,
and if I upload under codeigniter folder can I point somewhere in config to my codeigniter library in a way that my links remains without /codeigniter/
it's better to do like:
application/
system/
public_html/
index.php
for security reason, put your application
and system
folder outside your public_html
Form the user guide
For the best security, both the system and any application folders should be placed above web root so that they are not directly accessible via a browser.
So my setup is to have a custom public
directory in the codeigniter codebase and have the index.php
inside it.
And copy the .htaccess
and index.html
from either system
or application
folder to the codebase to forbid access to the base.
It will depend on the apache configuration on your server.
From my POV, it is better to have a structure like :
public_html/
codeigniter/
application/
system/
[...]/
Then, make your apache configuration point to this folder with something like :
<VirtualHost *:80>
DocumentRoot "path_to_the_folder/codeigniter"
ServerName yourDomain.loc
ServerAlias www.yourDomain.loc
<Directory path_to_the_folder/codeigniter/ >
#Your options
</Directory>
</VirtualHost>
and your /etc/hosts
file look like :
127.0.0.1 yourDomain.loc
127.0.0.1 www.yourDomain.loc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With