I have configured an apache server with document root to public_html folder and i want to keep my css files in the above directory as following code
<head>
<meta charset="utf-8">
<title>Name</title>
<link rel="stylesheet" type="text/css" href="../css/login_page.css">
</head>
Using above code i am not getting style changes related to css but if i keep my css file in public_html folder and change it to
<link rel="stylesheet" type="text/css" href="login_page.css">
there seems no problem. I want to know how to make the first code work.
4
Answers
Maybe it’s about cache? Have you tried clear cahce and reload the page?
To me it seams impossible, the apache server can only send the file in your
public_html
.(for security reasons)More that the server side, your browser will request a file that it’s not in the domain.
The only solution it’s to be in your
public_html
.Edit:
The only files that you work with were are above are php files of config files, apache will never work with files that are above the
public_html
It’s not clear enough for me, but if your problem is that css file in browser doesn’t update when you edit it, the solution is to disable cache for your site
In any browser: devtools -> network -> disable cache checkbox
example image
you cannot reference files, folders outside your
public_html
folder. Hence the name of the folder. It’s by design and it would be a BIG security risk if this would be possible.