在多个RewriteCond之间使用捕获

时间:2016-07-10 12:01:10

标签: mod-rewrite

鉴于此网址http:// sub .domain.org / sub / other_string我需要将其重写为:http://newdomain/sub/ ... < / p>

我正在尝试重写,但我想我想念RewriteCond。 在第二个Cond中,我可以使用第一个Cond的捕获吗?

    RewriteCond %{HTTP_HOST} ^(.*)\.domain\.org$
    RewriteCond %{REQUEST_URI} ^/%1/.*$ [NC]
    RewriteRule (.*) /%1/$1 [nosubreq,QSA,L]

0 个答案:

没有答案