I moved my project to HOST but I can still access .env with address mysite.com/.env and display this file with all variables and secure data. my .env file :
I have tried following steps to deploy laravel in the shared hosting.
1 - Edit the /etc/apache2/apache2.conf in Ubuntu OS. Please check appropriate file in other operating systems.
Options Indexes FollowSymLinks
AllowOverride All # Changed from None to All
Require all granted
Enable mod rewrite sudo a2enmod rewrite
Edit or create .htaccess in the root (Public html folder)
Order allow,deny
Deny from all
Options -Indexes
Order allow,deny
Deny from all
4 - Restart Apache server, sudo service apache2 restart
Note :- First two steps are used only in my own PC.