Insert CSS and JS files stored in another folder

Asked

Viewed 202 times

0

I have two domains: domain.com and domain.com.br created in the httdocs folder and being accessed normally. I have a folder called devphp as below:

inserir a descrição da imagem aqui

The domain.com and domain.com.br share the same information (css, js, img), but I’m not being able to successfully insert the files into the domains.

I tried in the following ways

<link rel="stylesheet" href="../dev/public/assets/_css/0_font-awesome.min.css" type="text/css" />

<link rel="stylesheet" href="C:\xampp\htdocs\dev\public\assets\_css\0_font-awesome.min.css" type="text/css" />

1 answer

0

C: is equivalent to using the protocol file:///, file is to load local files from the machine and not from the server, the broker in case would:

<link rel="stylesheet" href="/dev/public/assets/_css/0_font-awesome.min.css" type="text/css" />

If CSS is in the right folder and if the domain is really pointing to htdocs, now if the domain points to _public (using Virtualhost for example), so this would be correct:

<link rel="stylesheet" href="/assets/_css/0_font-awesome.min.css" type="text/css" />
  • insert using the first format (<link rel="stylesheet" href="/dev/public/Assets/_css/0_font-awesome.min.css" type="text/css" />), the files do not load and generate a failure when I try to open the link. I created a Virtualhost with the directory that contain the files and tested, even then it didn’t work.

Browser other questions tagged

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