【发布时间】:2018-07-27 01:21:11
【问题描述】:
我有一个类似下面的 apache 配置:
RewriteCond %{QUERY_STRING} ^site=(eu|jp|in)$ [NC]
RewriteRule ^/?fetchHomePage.action$ https://example.com/%1? [R=301,L,NC]
RewriteCond %{QUERY_STRING} (?:^|&)site=(eu|jp|in)(?:&|$) [NC]
RewriteRule ^/?fetchFirstPage.action$ https://example.com/firstPage/%1? [R=301,L,NC]
RewriteCond %{QUERY_STRING} (?:^|&)site=(eu|jp|in) [NC]
RewriteRule ^/?fetchSecondPage.action$ https://example.com/secondPage/%1? [R=301,L,NC]
我可以将“(eu|jp|in)”存储在某个变量中并在所有三个重写规则中重用该变量吗?
感谢这里的领导?
【问题讨论】:
标签: apache .htaccess mod-rewrite httpd.conf