Hi, I have a site I need to point to a certain page on the parent site. This site is hosted on Network Solutions which charges to use domain forwarding. I researched how to avoid this charge and went through all steps to forward the domain to the parent site. However, it now points to the home page of the parent site and not the page.
This code will check if the host of the current page is ‘buttonandsqueaking.com’, and if it is, it will redirect to the specific page on jimshore.com. Please, bear in mind that this will redirect all traffic to buttonandsqueaking.com to the specific page, you may want to consider that before proceeding.
Would I place this code inside the code or at the bottom above ? I just tried placing this in the theme.liquid file above the tag and it threw the following error:
Liquid syntax error (line 230): Unknown tag ‘redirect’
The code I provided should be placed in the theme’s theme.liquid file, but it should be placed inside the <head> section and not above it. The </head> tag is the end of the head section, so any code placed above it would not be executed.
Regarding the error message “Unknown tag ‘redirect’” it seems that the ‘redirect’ is not a valid liquid tag, I apologize for my previous response,
A possible solution would be to use a javascript redirect instead. You can add the following code to your theme’s theme.liquid file, inside the <head> section:
This will check if the host of the current page is ‘buttonandsqueaking.com’, and if it is, it will use javascript to redirect the user to the specific page on jimshore.com. Please, bear in mind that this will redirect all traffic to buttonandsqueaking.com to the specific page, you may want to consider that before proceeding.