Can replacing URL with pushState to a cleaner URL that redirects be bad for SEO?

ladlamuzamil
New Member
1 0 0

We have a Shopify store. It has URL structure for blogs like mysite.myshopify.example/blogs/blogname/article-name

To overcome Shopify rigid URL structure and make links more human-readable and memorable we'd like to use the following technique:

  1. Create redirect from non-existent (404) URL mysite.myshopify.example/blogname/article-name to an existing page mysite.myshopify.example/blogs/blogname/article-name
  2. On the existing page change URL in the address bar with the following Javascript:
let pretty_url_for_blog = window.location.href.replace('/blogs', '');
window.history.pushState({path:pretty_url_for_blog},'',pretty_url_for_blog);

– making site visitors see shorter URL mysite.myshopify.example/blogname/article-name

Is there any reason to think Google could penalize us for this? Which could be the arguments why it's good or bad for SEO? Any thoughts are welcome.

Replies 2 (2)
demib
Shopify Partner
119 12 60

Google will not penalize you for that but it is definitely NOT a solution that will be good for SEO - because:

  • Redirects do not pass all link value (internal link distribution is important too!)
  • As you cannot make server side redirect rules and change header codes I assume you will make the 404 redirects client side in which case Google may never actually see them
  • Users that organically link to your blog posts will not link directly to it 

I understand that you would like to change the fixed Shopify directories. But from an SEO point of view it's a VERY small factor. So, accept Shopify for what it is - don't fight it with bad workarounds, and focus on optimizing all the other SEO-factors. Trust me, that will produce great results. 

You could also move the blogging to a WP-solution on a subdomain. Many do that because the blog system on Shopify is not as flexible. 

SEO Geek since 1996, consultant author and public speaker. Admin of the Shopify SEO Facebook Group

Was your question answered? Kindly mark it as an Accepted Solution :-)
anwarjutt
New Member
1 0 0

No penalty for this. But it is ways better to live with any rigid url structure, then to build such bypasses.

Think just about computation ressources needed for crawling of Shopware inbuild urls and for crawling of those construction. You can easy check it with monitoring the CPU utilization while rendering of pages with default urls and with such artificial urls. OlansiChina

Don't shoot into own knee. Googlebot can indeed crawl javascript - but nobody said, it would love this.