Not Accessing Other Directories
Posted by: Dingus (---.vm12.cable.virginm.net)
Date: July 06, 2024 05:29PM

Hi all.

This can't be difficult for you guys.

I've found my virtual hosts work perfectly if they are in /wamp64/www/website.
However, if I house them in any other directory wamp fails to access them.

Is this normal or do I need to tweek wamp so it will also work outside wamp?

I've checked the vhost and it seems fine.

Options: ReplyQuote
Re: Not Accessing Other Directories
Posted by: Otomatic (Moderator)
Date: July 06, 2024 08:34PM

Hi,

If you move a folder in a VirtualHost, how do you expect Apache to know about it if you don't tell it!

You need to modify DocumentRoot and <Directory ...> in the relevant VirtualHost to reflect the new paths and restart Apache for this to be taken into account.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Not Accessing Other Directories
Posted by: Otomatic (Moderator)
Date: July 08, 2024 03:41PM

Hi,

If, originally, your local site is in c:\wamp64\www\site_dir\ and if the name of your site is "mysite", the relevant VirtualHost is :
<VirtualHost *:80>
  ServerName mysite
  DocumentRoot "c:/wamp64/www/site_dir"
  <Directory "c:/wamp64/www/site_dir/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>
If you move your site to d:\www\site_dir\, the VirtualHost must be changed to :
<VirtualHost *:80>
  ServerName mysite
  DocumentRoot "d:/www/site_dir"
  <Directory "d:/www/site_dir/">
    Options +Indexes +Includes +FollowSymLinks +MultiViews
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.