Relative and absolute path on Apache localhost

Joel picture Joel · Nov 9, 2010 · Viewed 8.5k times · Source

I have installed Apache on my local machine (Windows 7, using AppServ). I opened a library called "MySite" under AppServ directory, so to access it I use the following URL:

http://127.0.0.1/MySite

The problem is that when I use

<link type='text/css' href='/stylesheets/main.css' rel='stylesheet' media='all' /> 

The file is not loaded since it tries to look it in http://127.0.0.1/ instead of http://127.0.0.1/MySite .

How can I change this?

Thanksm

Joel

Answer

MnomrAKostelAni picture MnomrAKostelAni · Nov 9, 2010

Edit your apache.conf File and set your DocumentRoot to MySite