Using URL vs Filepath to include css?

61 Views Asked by At

Which one is better ?
Using URL to include css ?
<link rel="stylesheet" href="<?php echo BASE_URL; ?>/css/style.css">

Or, using filesystem ?
<link rel="stylesheet" href="<?php echo BASE_PATH; ?>/css/style.css">

BASE_URL containes the base url of the app, and BASE_PATH contains the file path to the base of the app.

1

There are 1 best solutions below

0
On BEST ANSWER

I assume BASE_URL has value like http://www.example.com/whatver and BASE_PATH is like /whatever.

Then these values are equal. One little plus for BASE_PATH - if you change scheme from http to https, you don't need to check if BASE_URL has new https scheme.