# 会員限定ページについて（リダイレクトがうまくいかない）

**URL:** <https://community.shopify.com/t/topic/96152>\
**Category:** 技術的なQ＆A\
**Created:** [February 1, 2022, 11:06pm UTC](https://community.shopify.com/t/topic/96152 "2022-02-01T23:06:34Z")\
**Posts on this page:** 3\
**Page:** 1

## AI-generated summary

会員限定ページへのリダイレクト時に、限定コンテンツが一瞬表示されてしまう問題。Shopifyの会員限定化記事を参考に実装中で、未ログイン時にVIPページ（page.titleが「VI」）でsend_to_loginをtrueにするLiquidロジックを使用。

技術背景: theme.liquidの{{ content_for_layout }}はページ本体を描画するため、リダイレクト処理より先にコンテンツがレンダリングされると“チラ見え”が発生。

提案された解決策: theme.liquidで{{ content_for_layout }}を条件分岐し、send_to_loginが設定された状況ではコンテンツを表示しないように制御（リダイレクト完了まで中身を描画しない）。

結果・現状: 提案の修正で問題は解消し、意図した表示になったと報告。現時点で解決済み。未回答の論点や追加作業はなし。

<div class="post-metadata">

**Author:** ![Masayuki](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@Masayuki](https://community.shopify.com/u/Masayuki)\
**Post date:** [February 1, 2022, 11:06pm UTC](https://community.shopify.com/t/topic/96152/1 "2022-02-01T23:06:34Z")

</div>

いつも親切なご回答ありがとうございます。

現在、こちらのサイトを参考に会員限定ページを作成しています。

[https://www.shopify.jp/blog/shopify-members-only-store](https://www.shopify.jp/blog/shopify-members-only-store)

質問なのですが、下記のようにリダイレクトを設定しても、一瞬だけ限定サイトが表示されてしまいます。

こちらは仕方のないことなのでしょうか？

```markup

```

何か解決策がありましたらご教授いただけますと幸いです。

■対象サイト

[https://agata-furniture.com/pages/vip](https://agata-furniture.com/pages/vip)

■対象コード

```markup
{% unless customer %}
    {% if template == "page" %} 
  		{% if page.title == 'VI' %}
        	{% assign send_to_login = true %}
    	{% else %}
        	{% assign send_to_login = false %}
    	{% endif %}
  {% else %}
  	{% assign send_to_login = false %}
  {% endif %}
{% endunless %}
  
  {% if send_to_login %}
  
  {% endif %}

```

---

<div class="post-metadata">

**Author:** ![Anonymous\_44fbe07fc59d9ccaacd70575fd5a5155](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/anonymous_44fbe07fc59d9ccaacd70575fd5a5155/32/194200_2.png) [@Anonymous\_44fbe07fc59d9ccaacd70575fd5a5155](https://community.shopify.com/u/Anonymous_44fbe07fc59d9ccaacd70575fd5a5155)\
**Post date:** [February 2, 2022, 12:44am UTC](https://community.shopify.com/t/topic/96152/2 "2022-02-02T00:44:48Z")

</div>

theme.liquidに

{{ content\_for\_layout }}

という行があると思います。こちらを

{% if send\_to\_login %}

{{ content\_for\_layout }}

{% endif %}

の様に書き換えで対応可能かと存じます。(コンテンツ部分を表示しないという条件設定です）

---

<div class="post-metadata">

**Author:** ![Masayuki](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@Masayuki](https://community.shopify.com/u/Masayuki)\
**Post date:** [March 6, 2022, 5:40am UTC](https://community.shopify.com/t/topic/96152/3 "2022-03-06T05:40:21Z")

</div>

株式会社フルバランス様

ご回答ありがとうございます。

ご返信が大変遅くなってしまい、申し訳ありません。

ご教授くださった方法で設定したところ、うまく表示されました。

ありがとうございました。
