jeudi 30 mars 2017

nginx root directory for laravel

I would be very grateful if someone could answer. I am trying to install my laravel project to virtual host. The server runs on nginx. Everything is ok except assets file.

The problem is the server does not load assets files. To be more exact:

asset()

function doesnt point to public path.

But the URLs (routes) are working perfect.

I copied htaccess files from public path to root.

Here is my htaccess files content:

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

Any helps guys! Thank you very much!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire