Windows 7 and xampp-win32-5.6.3-0-VC11-installer.exe
I am new to Apache. I am using it in a small business environment as an internal server. I am able to do stuff that I could not do in IIS. I have an issue with virtual hosts and relative addressing. With none virtual host directories (C:\sites\sites1 and C:\sites\sites2). DocumentRoot is C:\sites. I have a page in each directory that has a relative link to the other page. The links work as expected and I move back and forth between pages.
- Code: Select all
****** C:\sites\site1\site1.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Site 1</title>
</head>
<body>
<h1>Site 1</h1>
<a href="../site2/site2.html">Site 2</a>
</body>
</html>
****** C:\sites\site2\site2.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Site 2</title>
</head>
<body>
<h1>Site 2</h1>
<a href="../site1/site1.html">Site 1</a>
</body>
</html>
Now if I create 2 virtual host sites (C:\sites\vsite1 and C:\sites\vsite2) and place the same pages in the virtual host sites with the link modified it does not work. It puts the virtual host name at the front of the link so I can't get between virtual sites. I want to share CSS and Javascript files between virtual host sites and I want to use relative links. Is this some security measure that I can disable? Other than this virtual hosts works perfectly.
- Code: Select all
****** C:\sites\vsite2\site1.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Site 1</title>
</head>
<body>
<h1>Site 1</h1>
<a href="../vsite2/site2.html">Site 2</a>
</body>
</html>
****** C:\sites\vsite2\site2.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Site 2</title>
</head>
<body>
<h1>Site 2</h1>
<a href="../vsite1/site1.html">Site 1</a>
</body>
</html>