如何将localhost / dir重定向到localhost?

时间:2014-06-25 14:38:22

标签: android macos redirect localhost

我正在测试我的Android应用,我想检查系统中的所有图层。我的macbook上有服务器,我想将我的Android设备的所有请求重定向到macbook。我在Android上安装了主机并更改了主机文件。 Mac上的服务器正在使用localhost。与设备和电脑的连接是好的。但我的应用程序发送请求,如" localhost / dir / request"。 如果我不想在设备中更改localhost / dir / request,并且只想将所有类似localhost / dir / request的请求重定向到我的mac上的localhost / request,我需要做什么? 如何将所有localhost / dir / request重定向到localhost / request?

1 个答案:

答案 0 :(得分:0)

您可以在Web根文件夹中使用.htaccess文件。看看这个website about the .htaccess file

您的文件看起来像这样:

RewriteEngine On
RewriteRule ^(.*)/request$ http://example.com/request [L]
相关问题