Reputation: 306
I have a laravel application which contain an index file in its public folder which I can access using the following url:
myIpAddress/teamsync/public/index
But I want to use url like this:
myIpAddress/teamsync
to access my index file.
Upvotes: 0
Views: 114
Reputation: 34
Perhaps the best way to remove /public/...
is to set up your virtual host configuration file to set up the /public
directory as the document root. This kills two birds with one stone by allowing you to set yoursitename.com as Laravel's root, but also moving sensitive back-end files up away from the www
root folder.
<VirtualHost *:80>
ServerName myserver
DocumentRoot /var/www/yourproject/public
ServerAlias www.example.com
</VirtualHost>
Examples on how to use virtual hosts:
Upvotes: 1