How to use different 404 pages for secondary domains in hubspot

mayankk
Participant

How to use different 404 pages for subdomains or secondary sites in hubspot?

0 Upvotes
7 Replies 7
rOsborn123
Contributor | Elite Partner

I was able to find a solution that might help your problem. If you create a custom module for the content of the 404 page you set up in your system, you can parse the path to determine where the user was trying to navigate and alter the content of the 404 page based on that information. 

For example, if you're trying to display a specific 404 page when users are following a path that includes "/products", you could use the following code to pick up that specific scenario to display unique HTML acordingly:

{% set path = request.path %}
{% set params = path|split("/") %}

{% if "products" is within params %}

 

display your unique HTML here

{% else %}

 

standard HTML here

{% endif %}

sharonlicari
Community Manager

Thank you for sharing @rOsborn123 


¿Sabías que la Comunidad está disponible en Español?
¡Participa hoy en conversaciones en el idioma de tu preferencia,cambiando el idioma en tus configuraciones!

Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !


0 Upvotes
rOsborn123
Contributor | Elite Partner

@mayankk Did you ever find a solution to this?

0 Upvotes
edjusten
HubSpot Employee

Hi @mayankk   It is possible to create custom 404 pages and assign them to sepcific domains. The HubSpot Academy resource explains how to create a 404 page in your design manager.  

 

From there you will need to go to Settings > Marketing > Web pages > System pages to assign your 404 pages to your specific domains (be sure to click All domains at the top of the interface to select the correct domain). 

 

Thank you,

Ed Justen


Did my post help answer your query? Help the Community by marking it as a solution
0 Upvotes
mayankk
Participant

Right i did that , but it is redirecting to primary domain.

When i go to manage domain and click on specific domains ( edit ) , i saw an option for redirectoin but i dont want it to redirect to primary domain. I simple want to redirect no exits page to 404 page

 

1.png 

0 Upvotes
edjusten
HubSpot Employee

Hi @mayankk  If I am understanding you correctly, this is not possible. You won't be able to use the Domain Manager to redirect to a domain 404 page. You can redirect to a specific domain, and 404 will show if a page has yet to be set to live at the root of that subdomain. 

 

If this isn't your goal, please provide a bit more context (more screenshots and your HUB ID would be helpful also) and I'll do my best to advise you further.

 

Thank you,

Ed Justen 

 

 

 

 


Did my post help answer your query? Help the Community by marking it as a solution
0 Upvotes
mayankk
Participant

Hub ID: 2603840

 

I already set a 404 page for subdomain. Please refer SS.

But it is still redirecting to primary domain 404 page.

 

http://info.givebycell.com/marketing-materials 

http://info.givebycell.com/marketing-materials404  - WRONG URL TO CHEC404- for subdomain.PNGK 404 PAGE

0 Upvotes