首页 > 解决方案 > 向网站发布数据时在 URL 中隐藏 index.php

问题描述

我有一个索引文件,www.myserver.com/download/index.php 当用户访问www.myserver.com/downloadindex.php自动加载,但没有显示在浏览器 URL 框中 (=ok)

现在我需要将数据发布到同一个index.php文件中。

当我按照以下方式进行操作时,index.php 会在发布后显示在浏览器 URL 中(=bad)。

<form action="index.php" method="post">
    <input type="submit" name="testpost" value="TEST" />
</form>

当我按照以下方式执行此操作时,POST 数据会丢失(=坏)。

<form action="../download" method="post">
    <input type="submit" name="testpost" value="TEST" />
</form>

向 index.php 发布数据后如何隐藏它?该解决方案不应隐藏index.php整个服务器上的所有内容,而应仅隐藏这个特定的一个。

我试图制定一个 .htaccess 规则来隐藏“下载”目录中的 index.php,但我的知识是让它工作起来很糟糕。

标签: htmlapacheserver

解决方案


推荐阅读