0

特定のサーバー構成に固執しています。

  • 私はドメインを持っています: www.domain.com
  • モバイル ユーザーをm.domain.comにリダイレクトします

今まで、問題ありません。

特定のページでモバイル ユーザーを m.domain.com にリダイレクトしたくありません。

これは私が今持っているものです:

if ($mobile_rewrite = perform) {
    rewrite ^ http://m.domain.com redirect;
    break;
}

(疑似コード)のようなものが欲しい:

if ($mobile_rewrite = perform && Location != /path/* ) {
    rewrite ^ http://m.domain.com redirect;
    break;
}

ヒントをありがとう!

4

2 に答える 2

1

I actually found something using the $request var:

set $mobile_rewrite = [...] (perform or do_not_perferm)
if ($request ~* "path") {
    set $mobile_rewrite do_not_perform;
}
if ($mobile_rewrite = perform) {
    rewrite ^ http://m.domain.com redirect;
    break;
}

Maybe not the best solution, but it works!

于 2012-04-08T06:52:06.720 に答える