开发者

apache modrewrite refactor question

Is there a way to refactor this to use the same rule? I have a production site and a staging test site.

test site

RewriteCond %{HTTP_HOST} ^test.example.com$

RewriteCond %{REQUEST_UR开发者_运维知识库I} admin

RewriteRule ^(.*)$ test-admin.blurb.com$1 [L]

production site

RewriteCond %{HTTP_HOST} ^www.example.com$

RewriteCond %{REQUEST_URI} admin

RewriteRule ^(.*)$ admin.example.com$1 [L]


It is possible but I think you don’t want something like this:

RewriteCond %{HTTP_HOST} =test.example.com
RewriteCond test-admin.blurb.com .+ [OR]
RewriteCond %{HTTP_HOST} =www.example.com
RewriteCond admin.example.com .+
RewriteRule admin http://%0%{REQUEST_URI}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜