【问题标题】:index show content of an other file in httpdindex 显示 httpd 中其他文件的内容
【发布时间】:2012-06-05 07:25:18
【问题描述】:

如何配置 http.conf 来做到这一点:

当我向 localhost/myfolder/index.html 请求时,它将显示 /myfolder/myfile.html 的内容

求帮助

【问题讨论】:

    标签: configuration web-config apache


    【解决方案1】:

    在 Apache 中,您可以使用 Alias 指令,例如:

    Alias /myfolder/index.html /somewhere/myfolder/myfile.html
    

    或者你可以使用mod_rewrite,例如:

    RewriteEngine On
    RewriteRule ^/myfolder/index\.html$ /myfolder/myfile.html
    

    【讨论】:

      猜你喜欢
      • 2020-09-16
      • 2022-07-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-26
      • 1970-01-01
      • 2018-05-07
      • 1970-01-01
      相关资源
      最近更新 更多