【问题标题】:apache2 rewrite subfolder and file extensionapache2重写子文件夹和文件扩展名
【发布时间】:2016-11-10 11:36:38
【问题描述】:

我想重写domain.com/pages/welcome.php 在 apach2 下使用 htaccessdomain.com/welcome

【问题讨论】:

    标签: .htaccess apache2


    【解决方案1】:

    在文档根目录的 .htaccess 中,添加:

    RewriteEngine on
    
    RewriteRule ^pages/welcome/?$ /pages/welcome.php [L]
    

    这将允许您访问没有扩展名的 welcome.php 文件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-10
      • 2017-03-17
      相关资源
      最近更新 更多