【问题标题】:Rewrite rule combining both query string and passthrough is not working结合查询字符串和直通的重写规则不起作用
【发布时间】:2019-06-04 05:49:28
【问题描述】:

我正在尝试使用查询字符串 pageA?queryString 将页面 A 重定向到 pageB。但是在重定向时,pageB 应该在内部重定向。它应该通过并且在 URL 中应该显示 pageA 但在内部应该显示 page B 的内容

已经尝试过:

案例1:

RewriteCond %{QUERY_STRING} ^hideChrome$
RewriteRule (.*)/pageA(/*)$  $1/pageB/  [PT,L]

输出:

抛出错误:找不到pageB

案例 2:

RewriteCond %{QUERY_STRING} ^hideChrome$
RewriteRule (.*)/attribution(/*)$  $1/attribution1/  [L,R]

它被重定向到'pageB'并且URL也显示为'pageB'

【问题讨论】:

    标签: redirect mod-rewrite aem query-string


    【解决方案1】:

    试试

    RewriteCond %{QUERY_STRING} ^hideChrome$
    RewriteRule (.*)/pageA(/*)$  $1/pageB/  [PT,L,QSA]
    

    https://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_qsa

    【讨论】:

      猜你喜欢
      • 2015-09-10
      • 2012-03-08
      • 2018-07-26
      • 2016-08-13
      • 2016-11-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-18
      • 1970-01-01
      相关资源
      最近更新 更多