donglian1982 2017-02-07 21: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-07 23:55
    关注

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

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

报告相同问题?

悬赏问题

  • ¥15 怎么实现数组的循环累加,simulink
  • ¥15 51单片机最小开发板系统,想让寻迹小车在全检测到黑线(寻迹模块代码在第一块板子上)时蜂鸣器响(在第二块板子上)
  • ¥15 pbootcms多选调用成列表
  • ¥15 51单片机oled显示时钟
  • ¥15 小规模TSP问题的动态规划求解
  • ¥25 kubelet.service: Failed with result 'exit-code'.
  • ¥15 bitvise黑框内一键部署v2ray提示账户没有root怎么解决
  • ¥15 车型识别以及相似度匹配中细节特征提取以及图像模糊问题
  • ¥15 怎么用鸿蒙的ArkTs写出来啊
  • ¥30 websocket服务端多线程通信
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部