Bellow is my site directory structure:
htdocs/
My-Project/
public/
index.php
css/
img/
js/
src/
config.php
templates/
library/
I do not want any direct user access to any files inside the src
directory. src
contains my templating and backend logic scripts.
I want to set up my .htaccess
so that when the user goes to my website (root folder My-Project
), they are redirected to My-Project/public/index.php
. I would like the URL to simply look like My-Project.com
while on the index page.
Any help? I am hesitant to modify my .htaccess file as I see a lot of conflicting advice around here and on the net as to the best way to do this.
.htaccess
I'm just not sure which commands would accomplish both of the things I need. Would I need a .htaccess in the root to redirect to the /public/ folder, and then another inside /public/ to format the URL? – Graehmesrc
directories, but the scripts inpublic
directory should be able to access them. – GraehmeMy-Project
. – Matos