In Laravel the path for serving your web page is in the /public folder. By default after installing Laravel and navigating in a browser to the URL you will see a directory listing of all the Laravel files.  Here’s an easy way using an .htaccess file to redirect requests to the Laravel /public folder user mod_rewrite.

Create a .htaccess file in your root directory and add the following code.

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

Save your file and refresh your browser, you should now see the default Laravel splash page.

At Prodjex, we've worked with tons of hosts/server companies and have experienced what each has to offer. Whenever we're asked "Who would you recommend?", the answer is Liquid Web, hands down. They have a phenomenal support staff and their services are top notch. You should check them out -

Liquid Web Cloud VPS - 2GB/4GB/8GB/16GB Special Offer -Starting at $19.99

Thanks for stopping by. Happy coding!

3 Comments

  • Over Martinez says:

    Hi, I’m have a question.

    I have 2 laravel projects in my server, How can I do to make it works, Thank you very much for any help that you can give me.

    • Micky says:

      I would suggest using different hostnames (domain names) for each project.

    • Prodjex says:

      It all depends on your setup, would need some more information to help you.
      1. Are they under the same account but different sub-domains?
      2. Are they two different domains and .htaccess is not routing correctly?

      All depends on your setup. I run some setups where I have the same domain such as:
      -admin.domain.com
      -app.domain.com
      -portal.domain.com

Leave a Reply