0

I am creating a web app in php and I am using Homestead to test locally.

I have an MVC structure in my project. Here it is:

enter image description here

The file in the right side of the picture exists inside the 'Views' folder.

When I link a css with a relative path, it works: <link href="/css/bootstrap.min.css"

But when I try to link it with an absolute path it doesn't: <link href="http://fab.app/public/css/bootstrap.min.css"

Why? And how can I fix it?

PeeHaa
  • 71,436
  • 58
  • 190
  • 262
padawanTony
  • 1,348
  • 2
  • 22
  • 41
  • 1
    Drop the public. And pick up a tutorial / resource about relative URLs http://stackoverflow.com/questions/2005079/absolute-vs-relative-urls/21828923#21828923 – PeeHaa Jul 01 '16 at 11:43
  • 1
    @PeeHa Thank you. Do you endorse the tactic of defining a constant variable and then change it according to whether you are in production or development environment? Or just use `href="/css/normalize.css"`? – padawanTony Jul 01 '16 at 17:30
  • I almost always use the latter. – PeeHaa Jul 01 '16 at 18:37

0 Answers0