【发布时间】:2018-12-14 17:55:49
【问题描述】:
目前我正在使用: RewriteCond %{HTTP_HOST} ^sub1.test.example.net$ [NC] 重写规则 ^/?$ https://sub1.test.example.net/folder1/folder2/app/nodes/dir1 [R,L] RewriteCond %{HTTP_HOST} ^sub2.test.example.net$ [NC] 重写规则 ^/?$ https://sub2.test.example.net/folder1/folder2/app/nodes/dir1 [R,L] RewriteCond %{HTTP_HOST} ^sub3.test.example.net$ [NC] 重写规则 ^/?$ https://sub3.test.example.net/folder1/folder2/app/nodes/dir1 [R,L]
我正在尝试将 3 个不同环境的通用规则浓缩为可能的 2 行,例如:
重写条件:sub1 OR sub2 or sub3 重写规则:(sub1 OR sub2 or sub3).example.net/folder1/folder2/app/nodes/dir1
作为一个新手,我很抱歉,我已经阅读 apache mod rewrite 手册页几天了,但还没有破解它。即使是正确方向的一点也将是一个巨大的帮助。
【问题讨论】:
标签: mod-rewrite url-redirection