donglian1982 2017-02-08 05:43
浏览 116
已采纳

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

I installed XAMPP on my windows machine
I changed the DocumentRoot and Directory paths to
C:\dev\CustomCloud\prod 

Since I did have XAMPP working on windows , I changed to point at code that i need to setup and modify. Localhost I now see tons of 404 errors

This PHP code I am pointing at is trying to resolve an ALIAS of localhost/matchmaking/

Example:

C:\dev\CustomCloud\prod\assets 

Is

http://localhost/matchmaking/assets/

How can I get the apache /xampp/ php to use an alias ?

This is easy with virtual directory with IIS for MS projects asp.net but I was looking at this article http://httpd.apache.org/docs/2.4/urlmapping.html

So would i do something like Alias or ScriptAliasMatch ?

 Alias "/docs" "/var/web" ... 
 ScriptAliasMatch "^/~([a-zA-Z0-9]+)/cgi-bin/(.+)"   "/home/$1/cgi-bin/$2"

Inside my config

  #DocumentRoot "C:/xampp/htdocs"
  #<Directory "C:/xampp/htdocs">
  #"C:/dev/CustomCloud/prod"
  DocumentRoot "C:/dev/CustomCloud/prod"
  <Directory "C:/dev/CustomCloud/prod">
  • 写回答

1条回答 默认 最新

  • douren1891 2017-02-08 07:55
    关注

    Try to add this into configuration, and reload/restart service.

    Alias "/matchmaking/assets" "C:\dev\CustomCloud\prod\assets"
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿