Page 1 of 1
How to add virtual directory
Posted: Wed Mar 26, 2014 8:04 pm
by weixin268
Hello!
Using Linux or Apache, if the web root is at d:\web, how to add virtual directory like IIS, e.g. add d:\share as a virtual directory.
Re: How to add virtual directory
Posted: Wed Mar 26, 2014 9:10 pm
by requinix
I think what you're looking for is
Alias.
Code: Select all
Alias /share D:\share
<Directory D:\share>
Order allow,deny
Allow from all
</Directory>
Re: How to add virtual directory
Posted: Wed Mar 26, 2014 9:41 pm
by weixin268
Hello!
This is not php format, right?
Re: How to add virtual directory
Posted: Wed Mar 26, 2014 10:14 pm
by requinix
Right. It's better to let Apache do it than PHP.
Re: How to add virtual directory
Posted: Thu Mar 27, 2014 5:22 am
by weixin268
Hello!
Tried to add virtual directory into the section of Aliases, but without functioning. Any body can help? Thanks!
Server: Buffalo LinkStation
1. edited httpd.conf at /etc/apache
2. Add virtual directory at the section of <IfModule mod_alias.c>
Alias /share "/mnt/disk1/Share"
<Directory "/mnt/disk1/Share">
Options None
AllowOverride All
Order allow,deny
Allow from all
</Directory>
3. then performed apache restart
4. try to open
http://192.168.0.100:81/share/test.htm
it's 404 - Not Found
Re: How to add virtual directory
Posted: Thu Mar 27, 2014 4:16 pm
by requinix
It looks right. What if you have Options +Indexes and go to just /share?