Changing the public folder on webserver

asked Dec 12, 2012 in Shared Hosting by DinoGuy (2,130 points)
Before launching my site I tested it at a free server hosting
I used their directory structure which is like this:
root folder \
public folder \public_html
using this structure I kept all the library files in the root folder and all the public data in \public_html
So my structure was like this:
/include(all  library files)
/logs(log files)
/public_html/ other public files
only public_folder content is  could be accessed via URL
so my URLs were something like this

When I completed the site, I moved it to go hosting service, but now I can’t find the same directory permissions I had in my previous free hosting. , All the files are in root folder and are all accessible via URL and so the URL became like this:

I want to redirect the URL requests to  the public_html folder,  to make library file unavailable to the public.
Can anyone please help
Thanks in advanced

1 Answer

0 like 0 dislike
answered Dec 12, 2012 by expert (14,380 points)
In a  Linux web-server using cPanel,  the home directory is usually /home/username/public_html. If a file is  uploaded to public_html it is accessible directly . So if you upload your files to the directory /home/username/public_html/ , you will have to access it from
If you uploaded the files to /home/username/public_html/directory, you need to access it from
Check with your hosting server and move your  files from /home/username/public_html/ to /home/username/public_html .