【发布时间】:2017-02-08 05:43:15
【问题描述】:
I installed XAMPP on my windows machine
I changed the DocumentRoot and Directory paths to
C:\dev\CustomCloud\prod
因为我确实在 windows 上运行了 XAMPP,所以我改为指向我需要设置和修改的代码。本地主机我现在看到大量 404 错误
我指向的这个 PHP 代码正在尝试解析 localhost/matchmaking/ 的别名
例子:
C:\dev\CustomCloud\prod\assets
是
http://localhost/matchmaking/assets/
如何让 apache /xampp/ php 使用别名?
对于 MS 项目 asp.net,使用带有 IIS 的虚拟目录很容易,但我正在查看这篇文章 http://httpd.apache.org/docs/2.4/urlmapping.html
那么我会做类似Alias 或ScriptAliasMatch 的事情吗?
Alias "/docs" "/var/web" ...
ScriptAliasMatch "^/~([a-zA-Z0-9]+)/cgi-bin/(.+)" "/home/$1/cgi-bin/$2"
在我的配置中
#DocumentRoot "C:/xampp/htdocs"
#<Directory "C:/xampp/htdocs">
#"C:/dev/CustomCloud/prod"
DocumentRoot "C:/dev/CustomCloud/prod"
<Directory "C:/dev/CustomCloud/prod">
【问题讨论】:
-
请粘贴您的配置。
-
如果可能的话,您可以更改 Windows 主机 superuser.com/questions/249723/…
-
@CalosKao 这是我在 apache config 中修改的唯一部分
-
@kumarsher45 不——不是这样