#hosting #deployment #laravel

.Htaccess to remove public from laravel app

create a .htaccess file in the root of your project and paste the following code in the file.

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

And you are all set to go. Happy coding.

PS: If you want a complete guide for hosting laravel project in a shared server you can it from here


Hi, I am Samgan, I know the adds are bit annoying but i hope you understand. Talking about me, I excel at solving complex problems involving logic and step by step breakdown of the problem. Besides, to develop complex algorithms, I specialize in problem framing, systems design, and product development strategy. Sometimes I also enjoy public speaking.  

I am also the creator of penit.ink, a site which provides young writers with a free hand place to show their creation to the world. Irrespective of the niche, if you write this place is defiantly for you.