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"
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?