Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 阻止apache用localhost替换完全限定的服务器名?_Macos_Apache_Url Rewriting - Fatal编程技术网

Macos 阻止apache用localhost替换完全限定的服务器名?

Macos 阻止apache用localhost替换完全限定的服务器名?,macos,apache,url-rewriting,Macos,Apache,Url Rewriting,我已经在High Sierra的myserver.mycollege.edu上安装了MAMP 如果我将浏览器(chrome)指向http://myserver.mycollege.edu/some/path,地址栏中显示的是localhost/some/path 如果some/path/index.html包含指向myserver.mycollege.edu/some/other/page的链接,则该链接将替换为localhost/some/other/page 当其他用户从他们自己的机器访问我

我已经在High Sierra的
myserver.mycollege.edu上安装了MAMP

如果我将浏览器(chrome)指向
http://myserver.mycollege.edu/some/path
,地址栏中显示的是
localhost/some/path

如果
some/path/index.html
包含指向
myserver.mycollege.edu/some/other/page
的链接,则该链接将替换为
localhost/some/other/page

当其他用户从他们自己的机器访问我的内容时,会发生这种情况!这显然失败了,因为他们的浏览器现在正试图访问他们自己机器上的web服务器,而不是我的


所以我的问题是,是什么导致了这个URL重写,我该如何阻止它?

我应该提到的一件事是
some/path
是mediawiki-1.28.1。 该目录提供的顶级页面是index.php,它将做一些配置工作,作为提供顶级页面的一部分

localhost
实际上是在LocalSettings.php中硬编码的:

在完全限定URL中使用的协议和服务器名称
$wgServer=”http://localhost";

替换为myserver.mycollege.edu
修复了该问题