【发布时间】:2017-04-14 22:27:31
【问题描述】:
我正在尝试获取域中的所有页面,例如域 example.com 上的页面,以便在不编辑 url 的情况下通过 index.php。我可以使用 htaccess 和 php。例如,在域 example.com 上,我可以转到 example.com/thefile.php,它仍然会显示主文件。
【问题讨论】:
我正在尝试获取域中的所有页面,例如域 example.com 上的页面,以便在不编辑 url 的情况下通过 index.php。我可以使用 htaccess 和 php。例如,在域 example.com 上,我可以转到 example.com/thefile.php,它仍然会显示主文件。
【问题讨论】:
我通过使用 NamelessMC 的 .htaccess 解决了这个问题。 .htaccess 文件是:
Options +FollowSymLinks
Options -Indexes
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^.*$ ./index.php
【讨论】: