开发者

How do I Alias in Apache properly? Trying to get to another drive in localhost with PHP

I installed Appserv and made a .php:

D:/Appserv/www/x/y/file.php

Then I have a folder, like E:/foldie. I want my .php to mess with that folder. I found this online:

<IfModule mod_alias.c>
     Alias /foldie/ "E:/fol开发者_如何学运维die"
     <Directory "E:/foldie">
          Options Indexes MultiViews
          AllowOverride None
          Order allow,deny
          Allow from all
     </Directory>
</IfModule>

So I added it to my httpd.config file.Then I added the following to file.php:

echo(realpath("../../foldie/"));

I was expecting G:/foldie, but nothing happened.

Help?


That isn't exactly how alias works. Alias means that when Apache receives a request: domain/<aliased-path> it will return path/to/alias. It works for HTTP requests, but it does not work for working on the local file system -- that does not go through Apache.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜