D
D
D44k2015-05-08 19:19:23
Laravel
D44k, 2015-05-08 19:19:23

Path to public Laravel on server?

Project in laravel.
In local env everything works.
Transferred the project to the server, all links are incorrect, without the public directory:
src="site.ru/assets/images/img.jpg"
The start page is set as site.ru/public/index.php
echo public_path();
Displays the correct path www/.../site.ru/public/
Twig template engine, paths are set through: Tell me
src="{{ asset('assets/images/logo.png') }}"
where fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
D44k, 2015-05-08
@D44k

Found a solution:
Redirect all requests to the piblic folder - create .htaccess at the root:

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

There is no need to change the start directory in the hosting admin panel.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question