0

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?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.