I am working on laravel project and deploye it on Hostgator server.
Everything is working fine but I don't want to run my site like www.xyz.com/public
. I want to remove /public
from the url. For this, I am following this link (Method II : Moving the contents of public folder to root directory). After this my Home page is working fine on www.xyz.com
. But when I try to access www.xyz.com/about
or www.xyz.com/admin
it returns a 404 page, "not found error".
I am new to laravel
can someone suggest me what should I do to solve this problem.
Just follow below steps:
1.Create a folder
myappnamebase
in your document root folder2.Put all your contents of the application except the public folder content to myappnamebase folder
3.Put all your public folder content in
public_html
folderThen bring the following changes:
Inside public_html->index.php
instead of
add
instead of
add
Inside myappnamebase->bootstrap->paths.php do editting so that it looks like following
Finally dont forget to upload .htaccess in the
public_html
folder. It should look like following: