I'm trying to publish my first Symfony Project in production, but I'm very worried about security, I have taken the following measures:
1) First: Delete on /var these directories: cache, logs and sessions
2) Second: Changed of default name for cookie session (client side: symfony)
3) Trhee: Creating a .htaccess in root directory of application
My problem is about the .htaccess. The goal is dennied access to others directories of application like: /app, /src, /test, /var, /vendor.
I'll write the follow rules in .htaccess and puted it in root directory of my app: myDevelopedApp/.htaccess.
.htaccess
#Checking if module is avalaible
<IfModule mod_rewrite.c>
#Using the rewrite engine
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
#Rewrite rule to redirect the request
RewriteRule ^(.*)$ web/$1 [QSA,L]
<IfModule>
The problem it's not working, I can not access to web folder when I write the rules. Apache hides the application myDevelopedApp when I try to access it by browser
What I'm wrong? Any other recommendation to improve security in production enviroment is welcome, thanks so much.