Macos 阻止apache用localhost替换完全限定的服务器名?
我已经在High Sierra的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 当其他用户从他们自己的机器访问我
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
修复了该问题