【问题标题】:Does mod_rewrite set `Alias` automatically or should it be explicitly specified when doing a `RewriteBase`?mod_rewrite 是自动设置“别名”还是应该在执行“RewriteBase”时明确指定?
【发布时间】:2012-02-10 13:00:05
【问题描述】:

发件人:RewriteBase Apache Docs

        #  /abc/def/.htaccess -- per-dir config file for directory /abc/def
        #  Remember: /abc/def is the physical path of /xyz, i.e., the server
        #            has a 'Alias /xyz /abc/def' directive e.g. #

        RewriteEngine On

        #  let the server know that we were reached via /xyz and not
        #  via the physical path prefix /abc/def
        RewriteBase   /xyz

        #  now the rewriting rules
        RewriteRule   ^oldstuff\.html$  newstuff.html 

这些行:

        #  Remember: /abc/def is the physical path of /xyz, i.e., the server
        #            has a 'Alias /xyz /abc/def' directive e.g. #

意味着
mod_rewrite 会根据 .htaccess 文件自动设置 Alias /xyz /abc/def' 或显示在 conf 文件中明确指定?

【问题讨论】:

    标签: apache .htaccess mod-rewrite url-rewriting apache2


    【解决方案1】:

    它不会自动设置Alias:您需要在服务器配置中明确定义它,而不是.htaccess

    【讨论】:

      猜你喜欢
      • 2021-06-01
      • 1970-01-01
      • 2011-12-16
      • 1970-01-01
      • 1970-01-01
      • 2023-02-19
      • 1970-01-01
      • 2021-10-23
      • 2016-01-08
      相关资源
      最近更新 更多