Redirect 'Register' button in header to different URL

Hello I’m hoping a coding expert out there can help!

I am trying to edit code to make the register button in the header go to a different URL.

I found the below code in header.liquid and changed the href from what it was by default, to the page I want to go to (pages/register-now). The button now clicks through to the correct URL, but the content on the page isn’t loading? Is there some code in there that’s preventing the page from loading? Or perhaps I’ve put it in entirely the wrong place?

{%- if settings.account_show_header_button and shop.customer_accounts_enabled -%}
                                            
                                                {%- if customer -%}
                                                    {{ 'layout.header.account' | t: name: customer.first_name }} {{ 'layout.header.register_and_account_separator' | t }} {{ 'layout.header.sign_out' | t }}
                                                {%- else -%}
                                                    {{ 'layout.header.register' | t }} {{ 'layout.header.register_and_account_separator' | t }} {{ 'layout.header.login' | t }}
                                                {%- endif -%}

The page I’m trying to get the register button to go to is https://summitsport.com.au/pages/register-now

Any help would be greatly appreciated!!

This could be as simple as:

pages/register-now

should be:

/pages/register-now

The leading forward slash makes the URL reference relative to your domain root whereas without, the URL is relative the the current path. Depending on the page you have that link on, it’s the difference between resolving to:

https://yourdomain.com/page-you-are-on/pages/register-now

and

https://yourdomain.com/pages/register-now

hth.

@Verdant-Spark thank you so much for the reply. I have realized that the issue is in fact happening for all pages I have built with a page builder app, when previewing a new theme that is not yet published. Do you know whether being in preview mode can cause these issues? The register button is actually going to the corrrect URL, but the page is just not loading (only the page title). The same with trying to direct to a contact us page that’s built with a page builder app, in the site preview it’s not loading. I would prefer to be able to check that the pages/links are actually working before publishing the new theme!

Ah I’ve found out that the pages built with page builder app will only work on published theme. Problem solved!