0

For years I've had an XAMPP local server set up in C: on my Win 7 machine. One of my local sites is a personal holiday database. Photos required for this are stored in D: as I can't clog up limted space on C: with them. They were accessed by using UNCs of the form "file:///d:/images/image.jpg"

Some time ago, that stopped working, apparently because of new default security settings in Firefox. The solution was to set 'security.fileuri.strict_origin_policy' to False instead of True. All was OK until very recently but now even that doesn't work, so it looks like something else has changed.

If anyone can shed any light on the situation then I'd be a happy bunny again - many thanks.

  • [Create an alias](https://stackoverflow.com/questions/6307047/different-folder-as-website-subfolder) and host the images over HTTP instead. – CodeCaster Jun 15 '18 at 11:26

1 Answers1

0

In case someone else finds themselves with the same issue, I'm going to try to answer my own question. I still don't know what has changed and has caused the problem. I assume it was something in FF because my local Apache settings haven't altered in years. My thanks, though, to CodeCaster who pointed me in the right direction.

This may not be the most elegant or sophisticated solution but it worked for me. Maybe someone could offer improvements.

1 add an alias directory to your XAMPP installation c:\xampp\apache\conf\alias

2 open httpd.conf and add the following to the end, then save it

 Include "conf/alias/*.conf"

this ensures that Apache looks for any aliases at startup

3 add separate .conf files for any aliases that you want to use and store them in the alias directory so, for example, I want an alias called 'holidays/images' and I want it to point to a directory on drive d: the file will be called holidays.conf and it lives in the alias directory

4 here's the file:

 <Directory "d:\graphics\holidays\images">
   Require all granted
 </Directory>
 Alias /holidays/images "d:\graphics\holidays\images"

5 restart Apache and we're good to go...;-)