使用 PHP - XAMPP 使用 Apache 配置文件为 localhost 创建别名


I installed XAMPP on my windows machine
I changed the DocumentRoot and Directory paths to
C:devCustomCloudprod 

由于我确实有XAMPP在Windows上工作,我改为指向我需要设置和修改的代码。 本地主机我现在看到大量 404 错误

我指向的这个PHP代码正在尝试解析localhost/matchmaking/的别名

例:

C:devCustomCloudprodassets 

http://localhost/matchmaking/assets/

如何让 apache/xampp/php 使用别名?

对于 MS 项目的 IIS 虚拟目录,这很容易 asp.net 但我正在查看这篇文章 http://httpd.apache.org/docs/2.4/urlmapping.html

那么我会做一些像AliasScriptAliasMatch的事情吗?

 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">

尝试将其添加到配置中,然后重新加载/重新启动服务。

Alias "/matchmaking/assets" "C:devCustomCloudprodassets"

最新更新