Question: 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.

Answer: 
Add the following to the first line of your .htaccess

```
DirectoryIndex public/index.php public/index.html

```
this works for me all the time. Create a .htaccess in your root directory outside of the public folder then add these 3 lines and boom problem solve.

```
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]

```