Let the people access only the homepage of the website

Topic summary

A user needed to restrict website access to only the homepage during a pre-opening event, preventing visitors from viewing other pages that weren’t ready yet.

Solution Provided:

  • Add Liquid code to the theme.liquid file (just above the </body> tag)
  • The code snippet uses conditional logic ({% unless template contains 'index' %}) to redirect all non-homepage traffic back to the homepage
  • Excludes the design mode to allow the store owner to continue editing

Outcome:

  • The solution was successfully implemented and resolved the issue
  • The user confirmed it worked as intended
Summarized with AI on November 6. AI used: claude-sonnet-4-5-20250929.

Hi everyone!

Is it possible to let people access only my homepage?

we have the pre-opening tomorrow and I want the people to access the homepage when they type my website.

The other pages are still not done yet, so I dont want them to see anything else.

How can I do that?

Here is my URL:

https://toroeatstreats.com/

Password: brayden

Thank you

Hi @abailea077 ,

You can add below codes to the theme.liquid file just above

This code will redirect all the users to the home page.

{% unless template contains 'index'  %}
      {% unless request.design_mode %}
        
      {% endunless %}        
    {% endunless %}

If you require further help to optimize your store, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!

Best Regards,
Makka

1 Like

Thank you! It did worked :slightly_smiling_face: