Laravel: Upload linked images and files

Asked

Viewed 244 times

1

I have the following code: <link rel="stylesheet" href="css/v1.css">, but the page does not load it. When inspecting element appears the following error: inserir a descrição da imagem aqui

As the image shows, it comes with the link: http://localhost/naslojas/css/v1.css, but if I add the public at the url: http://localhost/naslojas/public/css/v1.css, works normal.

This is happening with more than one file and with images as well. I was told that I would need to configure the hosts of shaman and of windows, but I have no idea how to do that and whether this is really the solution.

How can I solve this problem?

1 answer

3


Note: change paths according to your installation.

It goes in your file hosts in:

C:\Windows\System32\drivers\etc

And add new line:

127.0.0.1 naslojas.dev

then it goes in your file httpd-vhosts.conf in:

C:\xampp\apache\conf\extra

And adds:

<VirtualHost *:80>
    ServerName naslojas.dev
    ServerAlias www.naslojas.dev
    DocumentRoot "C:\xampp\htdocs\naslojas\public"
    ErrorLog "logs/dominio1-error.log"
    CustomLog "logs/dominio1-access.log" common
    <Directory "C:\xampp\htdocs\naslojas\public">
        DirectoryIndex index.php index.html index.htm
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

after all configured, restart apache.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.