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:
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
How can I change this?
Edit your apache.conf File and set your DocumentRoot to MySite
Actually, your question shows a flaw in your setup:
http://127.0.0.1/MySite to point to a certain directory, say
This implies that
/var/www/, and that
But you want
http://127.0.0.1/stylesheets to point to a subdirectory, say
It’s possible, but probably not very wise.
- Add an Alias for /stylesheets to
- Set the DocumentRoot to
/var/www/MySiteand access the site with
- Rewrite rules
You could change documentRoot: