404 URL Issue on ALL product pages

Solved

404 URL Issue on ALL product pages

sweetgeezvapes
Tourist
12 0 3

Hello developers & experts!


I have an issue which I cannot identify and I hope someone can help me with this.


For reference, our website URL is https://www.thecbdhut.co.uk/

 

When checking Ahrefs, For some reason, all of our product pages are showing a 404 error. It looks like the errored URL is using the H1 title. I am not sure what this issue is here and where I can find the issue to fix (in which code file and what to look for)

 

Please help if you can. I am sure it is a simple fix.

 

Here is a screenshot of the Ahrefs issue:

 

sweetgeezvapes_0-1731440657756.png

Thanks a lot!
Luke

The CBD Hut

LU
Accepted Solution (1)

Sweans
Shopify Partner
429 89 128

This is an accepted solution.

Hi @sweetgeezvapes,

 

It looks like there is space in product url (%20" - representing spaces). This structure is causing the 404 errors, as it doesn't match the actual URLs on your Shopify store.

 

-Verify Product URL Structure: Check the product URLs in Shopify. They should follow a structure like https://yourdomain.com/products/product-handle, where "product-handle" is a simplified version of the product title (usually lowercase, with hyphens instead of spaces).

 

-The URLs in the Ahrefs screenshot show a format like https://thecbdhub.co.uk/products/Dr%2... This structure seems incorrect, as it’s including spaces (%20) and full titles instead of simplified handles.

 

-Review your theme's product template files (e.g., product.liquid, main-product.liquid) to ensure the URL generation is using {{ product.url }} or {{ product.handle }}, not {{ product.title }}.

 

Once you verify that the URLs on your Shopify site are correct, update your sitemap (Shopify generates it automatically at https://yourdomain.com/sitemap.xml).

 

I hope this helps! If it does, please like it and mark it as a solution!  
If you need further assistance, feel free to reach out!

Regards,
Sweans

- Was my reply helpful? Please Like and Accept the Solution or let me know by Buying me coffee!
- Want to modify or custom changes on store Hire me.
- Feel free to contact me at info@sweans.com regarding any help.
- To know more about me check out www.sweans.com

View solution in original post

Replies 2 (2)

Sweans
Shopify Partner
429 89 128

This is an accepted solution.

Hi @sweetgeezvapes,

 

It looks like there is space in product url (%20" - representing spaces). This structure is causing the 404 errors, as it doesn't match the actual URLs on your Shopify store.

 

-Verify Product URL Structure: Check the product URLs in Shopify. They should follow a structure like https://yourdomain.com/products/product-handle, where "product-handle" is a simplified version of the product title (usually lowercase, with hyphens instead of spaces).

 

-The URLs in the Ahrefs screenshot show a format like https://thecbdhub.co.uk/products/Dr%2... This structure seems incorrect, as it’s including spaces (%20) and full titles instead of simplified handles.

 

-Review your theme's product template files (e.g., product.liquid, main-product.liquid) to ensure the URL generation is using {{ product.url }} or {{ product.handle }}, not {{ product.title }}.

 

Once you verify that the URLs on your Shopify site are correct, update your sitemap (Shopify generates it automatically at https://yourdomain.com/sitemap.xml).

 

I hope this helps! If it does, please like it and mark it as a solution!  
If you need further assistance, feel free to reach out!

Regards,
Sweans

- Was my reply helpful? Please Like and Accept the Solution or let me know by Buying me coffee!
- Want to modify or custom changes on store Hire me.
- Feel free to contact me at info@sweans.com regarding any help.
- To know more about me check out www.sweans.com

sweetgeezvapes
Tourist
12 0 3

Thank you Sweans! 

I will look into the issue and if no results, I will get back in touch.

LU