【问题标题】:Make all pages on domain go through specific page [duplicate]使域上的所有页面都经过特定页面[重复]
【发布时间】:2017-04-14 22:27:31
【问题描述】:

我正在尝试获取域中的所有页面,例如域 example.com 上的页面,以便在不编辑 url 的情况下通过 index.php。我可以使用 htaccess 和 php。例如,在域 example.com 上,我可以转到 example.com/thefile.php,它仍然会显示主文件。

【问题讨论】:

    标签: php .htaccess


    【解决方案1】:

    我通过使用 NamelessMC 的 .htaccess 解决了这个问题。 .htaccess 文件是:

    Options +FollowSymLinks
    
    Options -Indexes
    
    RewriteEngine On
    
    RewriteCond %{SCRIPT_FILENAME} !-d
    
    RewriteCond %{SCRIPT_FILENAME} !-f
    
    RewriteRule ^.*$ ./index.php
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-23
      • 1970-01-01
      • 2013-12-05
      • 2013-02-10
      • 2012-10-29
      • 2019-10-21
      相关资源
      最近更新 更多