Home › Forums › Back End › Link To CSS File With PHP › Re: Link To CSS File With PHP
@noahgelman, yes I agree with you that it should be linking to the root.
The only different point I mean is the flexibility.
If your app don’t go into following situation, just forget it.
You have an app hosted at http://www.example.com/myapp,
your folder structure like this:
myapp/
index.php
assets/
css/
main.css
js/
main.js
So in your template you might define the assets like this:
Someday you decided to change it to http://www.example.com/myapp-with-new-name,
ok you have to find each template and change the links.
Someday you decided to change it to http://www.example.com/apps/myapp…
It’s best to make an application flexible and can be put in any location if possible I think. It’s the same thing like:
1. You need to have a site url configured in WordPress.
2. You need to define the attachment path in many of your applications.