use of / on wampserver link paths??
Posted by: kreddigan (---.cpe.net.cable.rogers.com)
Date: December 21, 2015 03:32PM

I have WAMP installed on my laptop and I have two websites in my setup. The first one is my personal website with a mixture of html/shtml/php files and a database. The transferred files from my live site work fine, with just just a few minor tweaks required to exactly mimic the live site. This site is installed as a sub-directory of c:/wamp/www/ and I have had no issues with link paths. I used the "standard" ../file etc. for all of my paths to reference various files for css, ssi includes, images etc. in both my main directory and its subs.

The second wamp site is set up on my external hard drive (E) (setup up as a WAMP alias). It is a site that is maintained by several different people, including myself. When I downloaded the files I found that some contributors had built the paths on their pages using the "/directory/file" method instead of the "../directory/file" method and it appears that WAMP doesn't handle these links properly. The set up of this site is such that all the images/ ssi include, header and footer files are located in the main directory (e:/bgn). Pages that I have contributed work fine because I used the "standard " ../file" method to navigate back to that main directory.

I am not an experienced "server person", so I am at a bit of a loss to figure out why WAMP doesn't go back to this main directory when it parses a "/file" link. Is there a setting that has to be changed in WAMP to allow it to recognize the "/file" coding or have I done something wrong in my setup?

Any insight would be greatly appreciated.

Options: ReplyQuote
Re: use of / on wampserver link paths??
Posted by: RiggsFolly (---.as43234.net)
Date: December 21, 2015 05:13PM

Hi Kreddigan,

Its not WAMPServer that does not handle these links, remember WAMPServer installs Apache which is just like any other apache.

To correctly mimic a live site it is always best to create Virtual Hosts, in fact it is always best to use Virtual Hosts even for local sites.

Her is how to do it [forum.wampserver.com]

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: use of / on wampserver link paths??
Posted by: kreddigan (---.cpe.net.cable.rogers.com)
Date: December 21, 2015 07:43PM

Thanks for the reply.

I followed your procedures when I installed WAMP, however I was unsuccessful in establishing a VirtualHost. I could not determine why it wouldn't work. Some other posts on the forum suggested using Alias, so I tried that and it allowed me to access the website I have installed on my E drive.

So I guess my questions are:

1/ Is there a global parameter that tells the apache how to handle the "/" format?

2/If there is parameter, can I set it in the Alias directives, or does it only work for main and VirtualHost configurations?

Here is my laptop information. I forgot to send it in my first post.

Windows 10
Apache Version :2.4.9
PHP Version :5.5.12
Server Software:Apache/2.4.9 (Win32) PHP/5.5.12
MySQL Version :5.6.17

WAMP is up and running (Green). It handles my personal website just fine; css, ssi includes, database, etc.

Options: ReplyQuote
Re: use of / on wampserver link paths??
Posted by: RiggsFolly (---.as43234.net)
Date: December 22, 2015 01:14AM

Keep going with the Virtual Host solution.

If you have problems post you httpd-vhosts.conf file and we can debug it together

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: use of / on wampserver link paths??
Posted by: kreddigan (---.cpe.net.cable.rogers.com)
Date: December 22, 2015 08:44PM

Hi,

I removed the Alias setup and I finally was able to build Vhosts for my two sites. After a lot of trial and error, it all seems to work fine, except when I type "localhost/grandbanks" into my browser, I can't connect to that local website. However I can connect okay to it from "My Projects" and "My VirtuaHosts". My other site "calvertweb" connects fine when I type "localhost/calvertweb" into my browser. Keep in mind that the "grandbanks" files are located at E:/NGB/ but the "calvertweb" files are located at C:/wamp/www/calvertweb/.

It appears the localhost/grandbanks/ flows through the C:/wamp/www/grandbanks path since if I put a test file in the folder, it will find it. However, I couldn't find a way to redirect it to the E:/NGB and I don't know what part of the WAMP software controls that result. I'm very close to full operation except for that item.

Of course the issue with the " /file" linking not being recognized still exists on my "grandbanks" website. Lease let me know if you can see any errors in my setup (below).


Here is how I coded the VirtualHosts

<VirtualHost *:80>
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "c:/wamp/www">
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "e:/NGB"
ServerName grandbanks
<Directory "e:/NGB/">
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "c:/wamp/www/calvertweb"
ServerName calvertweb
<Directory "c:/wamp/wwww/calvertweb/">
AllowOverride All
Require local
</Directory>
</VirtualHost>

Options: ReplyQuote
Re: use of / on wampserver link paths??
Posted by: RiggsFolly (---.as43234.net)
Date: December 22, 2015 09:33PM

Once you have created a Virtual Host

And created the domain name in the HOSTS file `C:\windows\system32\drivers\etc\hosts` like this

127.0.0.1 localhost  grandbanks calvertweb
::1            localhost  grandbanks calvertweb


You use the Virtual Hosts menu OR just enter the domain name like `http:\\grandbanks`

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: use of / on wampserver link paths??
Posted by: kreddigan (---.cpe.net.cable.rogers.com)
Date: December 23, 2015 01:28PM

My "hosts" file was correctly filled and everything appears to be working, as far as access is concerned. According to various postings I have read, the use of the Virtual Hosts should have also fixed my initial issue i.e. the root relative links that work on the live site, should also work on my local WAMP site.

It is my understanding that by specifying the DocumentRoot "e:/NGB" in httpd-vhosts.conf, this directory becomes the root directory for my "grandbanks" website. The e:/NGB is the directory where all of my includes, images, etc. are located for this site, therefore any root relative link should reference back to e:/NGB to find the file specified in the link.

Any thoughts on what I'm missing would be appreciated.

Options: ReplyQuote
Re: use of / on wampserver link paths??
Posted by: RiggsFolly (---.as43234.net)
Date: December 23, 2015 04:36PM

Can you post a real example of what the others have used in these kind of links i.e. "/directory/file"

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: use of / on wampserver link paths??
Posted by: kreddigan (---.cpe.net.cable.rogers.com)
Date: December 23, 2015 07:03PM

Here is a file that sits in a sub-directory of E: NGB ("E:/NGB/Parish/index.shtml" ) The virtual include files which are root relative links (eg. "/top.shtml" ) are part of root directory NGB, as is the Table background image which is a normal relative link ("../paper.gif" ) This gif file works okay, but the includes do not. This page is typical of this site which has been in existence for nearly 20 years. If I edit the file with normal relative links (,,/ ), then the includes work and the page displays okay locally, as it does in the on-line site. As you can see from this page there are three links that could be updated but, I believe that the site has over 30,000 pages! This is a very large site so it is important that I figure out why the root relative links don't work.

<html>
<head><title>Newfoundland and Labrador Parish Records</title>
<!--#include virtual="/top.shtml"-->

<p><font face="Arial" size="+3" color="blue" ><strong>Parish Records <br>
for Newfoundland and Labrador
<br>
Listed by District</strong></font></p>

<h4>If anyone has or is willing to transcribe any<br>
additional parish records for inclusion, please<br>
e-mail us through the "CONTACT" button below.</h4>

<table width="70%" border="2" cellspacing="1" cellpadding="1" background="../paper.gif">
<tr><td><a href="1bdv-parish-idx.shtml"> Bay de Verde</a></td>
<td><a href="1bon-parish-idx.shtml"> Bonavista Bay</a></td>
<td><a href="1bur-parish-idx.shtml"> Burin</a></td>
<td><a href="1car-parish-idx.shtml"> Carbonear</a></td></tr>

<tr><td><a href="1ferr-parish-idx.shtml">Ferryland</a></td>
<td><a href="1fogo-parish-idx.shtml">Fogo </a></td>
<td><a href="1for-parish-idx.shtml">Fortune </a></td>
<td><a href="1hg-parish-idx.shtml">Harbour Grace</a></td></tr>

<tr><td><a href="1hm-parish-idx.shtml">Harbour Main</a></td>
<td><a href="1lab-parish-idx.shtml">Labrador</a></td>
<td><a href="1psm-parish-idx.shtml">Placentia and St. Mary's</a></td>
<td><a href="1pdg-parish-idx.shtml">Port de Grave</a></td></tr>

<tr><td><a href="../South_Coast/index.shtml">South Coast</a></td>
<td><a href="1swcoast-parish-idx.shtml">South West Coast</a></td>
<td><a href="1stbarbe-parish-idx.shtml">St. Barbe</a></td>
<td><a href="1sjcity-parish-idx.shtml">St. John's City</a></td></tr>
<tr>
<td><a href="1sje-parish-idx.shtml">St. John's East</a></td>
<td><a href="1sjw-parish-idx.shtml">St. John's West</a></td>
<td><a href="1trin-parish-idx.shtml">Trinity Bay</a></td>
<td><a href="1tw-parish-idx.shtml">Twillingate</a></td>
</tr>
<tr>
<td><a href="1wc-parish-idx.shtml">West Coast</a></td>
<td><a href="1oc-parish-idx.shtml">Other Countries</a></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<p></p>
<table background="../paper.gif" border="2" width="30%" cellpadding="1" cellspacing="1" >
<tr><td align="center">
<a href="../Church_Rpt/1-dist-ch-rpts-idx.shtml">Associated Church Reports <br>for various Districts</a>
</td></tr>
</table>
<p></p>
<!--#include virtual="/search-parish.shtml"-->
<!--#config timefmt="%B %d, %Y"-->
<p>Page Revised (<!--#echo var="LAST_MODIFIED"--> )</p>
<!--#include virtual="/foot.shtml"-->

Options: ReplyQuote
Re: use of / on wampserver link paths??
Posted by: RiggsFolly (---.as43234.net)
Date: December 23, 2015 09:21PM

Just a silly question! Have you activates SSI as by default it is not activated in WAMPServer

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: use of / on wampserver link paths??
Posted by: kreddigan (---.cpe.net.cable.rogers.com)
Date: December 23, 2015 10:26PM

Yes. I enabled the SSI Includes shortly after I first installed the web sites and the SSIs work fine in both of my websites. It appears that my only problem is with the recognition of the links using the root relative slash/. If the normal relative links are used, then everything is fine. This is the case for my personal website where I exclusively used normal relative links. From what I have read, the general consensus is that the vhost DocumentRoot datafill provides the directive that establishes where the "root" is for each virtual host/site. I tried several different datafills there, but it seems that none of them trigger the software to access the proper "root" location.

As I indicated all of my include and images files are in my main directory E:/NGB. This is also the directory where my index.??? file is located, I have tried the index file with a .php, .html and a .shtml extension but it didn't seem to matter which one I use. Have a look at my "vhost" information that I posted yesterday and see if you agree with the datafill for "grandbanks".

Grasping at straws at this point.

Options: ReplyQuote
Re: use of / on wampserver link paths??
Posted by: kreddigan (---.cpe.net.cable.rogers.com)
Date: December 27, 2015 02:59PM

In reviewing your last question re SSI Includes, I noticed they actually weren't fully functional on the "grandbanks" local website. I did some additional research/experiments on WAMP and VirtualHost and I think I have found part of the solution to the issue of the functionally of WAMP with regards to root relative links. According to some information that I read on a blog, the author claims that sites that are accessed through the "drive:/wamp/www/" path are subject to the default settings of the wampserver. However, those that are outside that path require Options to be added to each VirtualHost for such configurations. I had a closer look at that assertion and it appears to have merit. The location of my personal website fits the "default" criteria and as I mentioned it doesn't have a problem handling root relative links properly. So I added Options Includes etc. to my "grandbanks" VirtualHost definition and it appears the author was right on that point. I now get the include information fully working on pages in the root directory (E:/grandbanks) (I changed the root directory name since last posting).

Although the addition of the Options gave me full functionality on pages located in the root directory, when I post the files of a sub-directory, I only get partial functionality. I think this issue may be caused by the way that the webmaster coded his links in the various header and footer files. He used the root relatives links in files that are actually associated with pages in the 2nd, 3rd, etc. level sub-directories. These files. while physically located in the root directory, are used to display pages that may be several levels down the directory hierarchy. I'm sure some of the programming gurus would view that coding as a "no-no", although the live website server seems to be okay with it. I am able to correct this issue by adding the appropriate ../ etc. in the Include files so I will take this issue up with the site webmaster.

I would like to thank you very much for your assistance in getting me settled away with the VirtualHosts.

<VirtualHost *:80>
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "c:/wamp/www">
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "e:/grandbanks"
ServerName grandbanks
<Directory "e:/grandbanks">
Options Indexes Includes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>

<VirtualHost *:80>
DocumentRoot "c:/wamp/www/calvertweb"
ServerName calvertweb
<Directory "c:/wamp/wwww/calvertweb">
AllowOverride All
Require local
</Directory>
</VirtualHost>

Options: ReplyQuote


Sorry, only registered users may post in this forum.