Reputation: 160
I have the following problem:
My document root is /var/www/html, where I have an index.cgi script. The script prints in the browser an html page which it reads from the directory /var/www/pages. I also have a css file located in the dir /var/www/css. When the HTML page is printed to the user, it fails to include the css.
<link rel="stylesheet" type="text/css" href="../css/log.css">
Instead of going one directory UP, the html is searching for the css file in /var/www/html/css, which is invalid.
If I manualy open the HTML page, it finds the css, so the link is supposed to be correct?
If I move the css in the /var/www/html dir, i get another error, apache tries to execute the css file because of the apache settings, I guess. Here is my apache Virt config:
DocumentRoot /var/www/html
<Directory /var/www/cgi-bin >
SetHandler cgi-script
Options ExecCGI
</Directory>
<Directory /var/www/html>
SetHandler cgi-script
Options ExecCGI
</Directory>
How can I solve this, how to set the correct path for the css file?
Upvotes: 0
Views: 761
Reputation: 160
After a lot of reading I managed to see the problem. In the config file I had to add the following:
Alias /css/ /var/www/css/
Same goes for scripts and others, linked in some way.
Upvotes: 1