views:

57

answers:

2

Hi, I am developing a web application using PHP and mysql.I was doing the intial development in a windows machine and now shifted to ubuntu ultimate edition.I installed apache/PHP/Mysql and configured them. I placed my web folder in /var/www and when I give the URL in browser,I am not getting the page with CSS.

Not Working:

href="./css/style.css"

Working:

href="style1.css"

Is there anyway where I can give a common url so that it works both in linux and windows.

Thanks in advance!

Regards, Dwarak

A: 

If webroot is /var/www/sitename.com

and CSS lives in /var/www/sitename.com/css

always refer to it as /css/style.css, not ./css -- "/" is relative to the webroot not the file system. './css' will screw you up if you're at sitename.com/page/about

bonez
tried it..still not working..
A: 

Try using the full path http://localhost/[the proper path eg. css/style.css] and if it still doesn't work it's a file problem.

Check if You put the file where You expect it to be and if yes - try in console: chmod 0755 style.css

because You might be getting 403 error not 404

naugtur