Mikail G.
Mikail G.

Reputation: 478

Laravel in public 'www' directory how to protect

How to protect laravel app if I upload it to the public folder -'www' on my hosting ,I can't upload the app to the parent of 'www' folder because I previosly uploaded Laravel app folder to the parent directory of 'www', everything worked fine, exept mkdir() function doesn't work when laravel app is in the parent folder of 'www', so how can I protect Laravel app when its in the public folder?

Upvotes: 1

Views: 471

Answers (1)

ecrofeg
ecrofeg

Reputation: 1

Put your Laravel application in 'www' folder and create the .htaccess file in the root of your app. Make sure you have your mod_rewrite module on.

#.htaccess

RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]

This will remove .../public/... from URL.

Upvotes: 0

Related Questions