URL redirect possible on main page?

Oorja_Nutrition
Tourist
17 0 1

Hi I would simply like the visitors who come to my main website and have them redirect temporarily to a different web page where we are announcing that new products are coming soon.  I do want to keep the rest of the shopify pages as they are of course.  But I notice that Shopify doesn't allow URL redirect of the main website page, or at least something I couldn't figure out.  That sounds a big handicap.  I am a rookie when it comes to such things so bear with me.  

 

Could someone please suggest what I should do?

 

KR

Richard_
Shopify Expert
129 0 27

HI KR,

Add this code in theme.liquid file (inside the <head> tag)

{% unless template == 'index' %}
<script>
		window.location.replace( 'your_url' );
	</script>
{% endunless %}

 

Richard Nguyen | PageFly CEO
VenkatRam
New Member
1 0 2

Hi Richard_

 

I think there is a mistake in the code and it should be changed to:

 

{% unless template != 'index' %}
<script>
window.location.replace( 'your_url' );
</script>

furrydeath
Tourist
6 0 0

This is perfect. Exactly what I needed.

0 Likes
EdTardif_
New Member
1 0 2

Hey Richard!

 

I have a collection page in home > collections > catalog . I want to make that collection page the default page (homepage) so that when someone goes to my url for example: 123.com it redirects them directly to that collection page. Can I do that? If so, how?  

 

Thanks 

 

Ed Tardif,

bCommerce Web Solutions

yylow
New Member
1 0 0

Hi 

0 Likes