apache web 服务器重写删除域部分的路径(/path 而不是 http://IPaddress:port/path)

apache web server rewrites paths removing domain part ( /path instead of http://IPaddress:port/path)

我有几个 angularjs 项目,我通过 apache 网络服务器提供服务。 它们都在同一级别的不同文件夹下,所以我只想使用 apache 网络服务器。我使用组合框和按钮在项目之间导航。然后选择与 json 数组中的键值对匹配。值只是所选项目的 index.html

的路径

但是,有时(随机)它会导航到 project2/dist/index.html 而不是: http://10.0.1.27:8090/project2/dist/index.html

我在浏览器上收到 DNS_PROBE_FINISHED_NXDOMAIN 或 ERR_NAME_NOT_RESOLVED (chrome)

当我给出完整的 URL 而不是路径时,会随机发生其他事情:它有时会尝试转到(注意 http 后的冒号 ':') http//10.0.1.27:8090/project2/dist/index.html

编辑:导航部分:

html边

      <div class="dropdown">
        <div>
          <div class="col-lg-6">
            <div class="col-lg-3">
              Report
            </div>
            <div class="col-lg-3">
              <select  style="width:150px" id="urlListCombobox">
                <option value="">--Select--</option>
                <option ng-repeat="(key, value) in urlList" value="{{key}}">{{value}}</option>
              </select>
            </div>
          </div>
          <div style="float: right;margin-right: 30px;">
            <button  type="button"  style="min-width: 100px;"  class="btn btn-primary pull-right" ng-click="redirectUrl()">Get Report</button>
          </div>
        </div>
      </div>

Javascript边

$scope.urlList = {
  "/project1/dist/index.html" : "Project 1",
  "/project2/dist/index.html" : "Project 2",
  "/project3/dist/index.html" : "Project 3",
  "/project4/dist/index.html" : "Project 4",
  "/project5/dist/index.html" : "Project 5"
};

$scope.redirectUrl= function(){
  var url = $("#urlListCombobox").val();
  if(url != 0){
    window.location=url;
  }
}

知道为什么会发生这种情况吗? 任何评论表示赞赏。

最近我需要 "Rewrite on" 一个 .htaccess 文件。在此之后,我回顾了发生次数的增加。我还从

更新了 httpd.conf 文件
<Directory />
    AllowOverride None
    Require all denied
</Directory>

<Directory />
    AllowOverride All
    # Require all denied
</Directory>

重写的问题?有谁知道apache的这种bug吗?

提前致谢。

所以这是纯粹疏忽的结果,与 apache 无关:)

我两个月前的一次更改导致了重复的功能。

$scope.redirectUrl= function(){
      var url = $("#urlListCombobox").val();
      if(url != 0){
        window.location=url;
      }
    }

下面的重复函数是浏览器随机选择的(我不知道是什么原因)。

$scope.redirectUrl= function(){
      var url = $("#urlListCombobox").val();
      if(url != 0){
        location.replace("http://" + url)
      }
    }

删除重复项解决了问题。