I am using AWS to host my website. My domain is pointing to
/root/code/website/
Now i want to put user realted custom CSS to this path
/root/code/resources/
I have tried
<link href="../resources/1111.css">
but its not working. Is there any way to include these css files to my PHP scripts.
If you php file's path is
/root/code/website/index.php
and for CSS
/root/code/resources/custom-styles.css
then <link href="../resources/custom-styles.css">
will work fine, unless this file is not the file which is being served, i.e if this file is getting included in some other file, the path should be w.r.t that file
i.e for file
/root/code/website/dist/index.php
<link href="../../resources/custom-styles.css">
will work.
It depends on how you configured your AWS. First of all you need allow permission via nginx, apache to directory outside of your project (/root/code/resources/). Then configured nginx or apache server
Example for Nginx
location ~* \.(css) {
root /root/code/resources/;
}
and your path will be
<link href="1111.css">