在 php 中隐藏 url

Hide url in php

我有一个 url 用于发送和检索 json 数据。现在我想隐藏 url 以显示不同但能够发送和接收 json 数据的方式 http://freeprojects4u.com/setubandhmultiaction/setubandh.setubandh, this url is also sends and receives json data from this app: https://play.google.com/store/apps/details?id=com.setubandh&hl=en (Setubandh)。但我认为这个站点在 asp 中,但我想在 php 中做同样的事情。请帮我做这件事,或者建议任何指南或方法或任何 link 我可以这样做的地方。谢谢。我尝试了很多方法,但都不尽如人意。请建议我最好的方法。 (我曾尝试 url 使用 .htaccess 进行屏蔽)

看看你有什么 mentioned/elaborated 在进一步的评论中:

  1. 要求#1 - 现在 url 就像示例。com/sendandreceive。php 但我希望它成为示例。com/sendandreceive/sendand.sendand。

-> 我认为你可以在这里做的是你可以在 .htaccess 中重写相同的规则。

  1. Requirement#2 - 当 example.com/sendandreceive/sendand.sendand 在浏览器中打开时,它必须是 return null,这意味着我不想让我的数据暴露给public.

-> 这也可以在您的 .htaccess 文件中执行,您可以在其中检查请求的用户代理并将其限制为仅移动用户代理访问。您可以为消息创建一个页面,说不允许来自特定 source/browser 的请求(您可以从您的 htaccess 重定向到此页面,您可以在其中检查您的用户代理。参考它可能会有所帮助 - https://wordpress.org/support/topic/how-to-redirect-links-for-mobile-using-htaccess