Search code examples
phplaraveldeploymenthostingweb-hosting

how To get rid of /public when deploy Laravel on shared host?


i have a Laravel project, and i have deployed it on Hostinger as a shared host,

my shared host structure :


[public_html] -> [contains all the files of laravel project also public of laravel]

[public_html] -> [contains .htaccess beside laravel project]

enter image description here


[.htaccess beside laravel project contains this] ->

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

the problem is

now everything working correctly but the problem is i have /public after my domain

it should be www.domain.com/ but i get www.domain.com/public/

but also i can go to www.domain.com/login also i can go to www.domain.com/public/login

but i can not go to www.domain.com/

it redirects me back to www.domain.com/public/

how to solve it ? please


Solution

  • i just uploaded laravel beside

    public_html

    as laravel after that i went to laravel/public

    and i moved all the files including htaccess of laravel project

    to

    public_html

    after that i added the /laravel/ to each path in index.php

    and this is everything , without doing anything further