开发者

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

开发者 https://www.devze.com 2023-03-18 03:01 出处:网络
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:

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

精彩评论

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