gpt4 book ai didi

iphone - 在 localhost 服务器上为 iphone 和 ipad 测试网站

转载 作者:行者123 更新时间:2023-11-28 19:54:30 26 4
gpt4 key购买 nike

我想要做的是在我的 iPhone 或 iPad 上预览我在自定义本地主机服务器(使用 Mamp Pro 设置)上构建的内容。本地主机在 http://devsite:8888 下而不是 http://localhost:8888 .

我已尝试找到类似内容的说明 here .结果是能够看到文件,但它只是服务器上的文件列表,并没有获取 index.php——没有启用预览。我已经三重检查以确保我在根目录中也有一个正确的索引。

添加了/etc/apache2/extra/httpd-vhosts.conf 文件 https://gist.github.com/07223bf788ef1e2e1411

最佳答案

将其放入您的 .htaccess 或 httpd.conf(在 OSX 上通常为 /etc/apache2/httpd.conf):

DirectoryIndex index.php

如果将它放在 .htaccess 中,请确保在 httpd.conf(或 Web 服务器的任何自定义配置文件)中的某处你有这个(将 /var/www/html 替换为目录你的 .htaccess 文件在哪里):

## These lines can go anywhere in the main config file:
AccessFileName .htaccess
<Directory "/var/www/html">
AllowOverride All
</Directory>

此外,确保您的 /etc/hosts 文件包括:

127.0.0.1       devsite
# Or whatever your local computers IP is:
# 192.164.2.164 devsite

这样主机名就能正确解析。


编辑:

从评论来看,听起来您的虚拟主机可能需要额外配置。您可以将 /etc/apache2/extra/httpd-vhosts.conf 文件的内容放入您的问题中吗?

关于iphone - 在 localhost 服务器上为 iphone 和 ipad 测试网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7519814/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com