Learn how to modify URL structures for different content types in your Shopify store. This guide covers all methods from basic to advanced approaches.
Understanding Shopify's Default URL Structure
Default Shopify URLs follow this pattern:
- Products:
/products/product-name
- Pages:
/pages/page-name
- Blogs:
/blogs/blog-name
- Collections:
/collections/collection-name
Method 1: Using URL Redirects (Recommended for Beginners)
Step-by-Step Process:
- Go to Shopify Admin → Settings → Navigation
- Scroll to "URL Redirects"
- Click "Create URL redirect"
- Add your desired URL in "Redirect from"
- Add original Shopify URL in "Redirect to"
Example redirects:
From: /shop/product-name
To: /products/product-name
From: /about
To: /pages/about-us
From: /blog
To: /blogs/news
Method 2: Using Liquid Code (Advanced)
For Products:
{% if template contains 'product' %}
<script>
if (window.location.pathname.includes('/products/')) {
const newPath = window.location.pathname.replace('/products/', '/shop/');
window.location.href = newPath;
}
</script>
{% endif %}
For Pages:
{% if template contains 'page' %}
<script>
if (window.location.pathname.includes('/pages/')) {
const newPath = window.location.pathname.replace('/pages/', '/');
window.location.href = newPath;
}
</script>
{% endif %}
For Blogs:
{% if template contains 'blog' %}
<script>
if (window.location.pathname.includes('/blogs/')) {
const newPath = window.location.pathname.replace('/blogs/news', '/blog');
window.location.href = newPath;
}
</script>
{% endif %}
Method 3: Using .htaccess (For Custom Domain Setup)
Note: Only works with certain hosting configurations
RewriteEngine On
RewriteRule ^shop/(.*)$ /products/$1 [L,R=301]
RewriteRule ^blog/(.*)$ /blogs/news/$1 [L,R=301]
Important Considerations
SEO Impact:
- Set up 301 redirects for all changed URLs
- Update your sitemap
- Give search engines time to recrawl (2-4 weeks)
- Monitor rankings for affected pages
Before Making Changes:
- Backup your theme
- Document all current URLs
- Test on a development store first
- Update internal links
- Check analytics tracking
Common Issues and Solutions:
- 404 Errors:
- Double-check redirect rules
- Verify URL patterns
- Clear cache
- Duplicate Content:
- Implement canonical tags
- Verify redirect chains
- Check robots.txt
- Lost Rankings:
- Maintain old URLs with redirects
- Submit updated sitemap
- Monitor Google Search Console
Best Practices:
- Keep URLs short and readable
- Use hyphens for separators
- Avoid special characters
- Maintain consistent structure
- Plan URL hierarchy carefully
URL Structure Tips by Content Type:
Products:
- Consider:
/shop/category/product-name
- Alternative:
/product/product-name
Pages:
- About:
/about
instead of/pages/about
- Contact:
/contact
instead of/pages/contact
Blogs:
- Main blog:
/blog
instead of/blogs/news
- Categories:
/blog/category-name
Maintenance Tasks:
- Regular redirect audit
- Check for broken links
- Monitor analytics
- Update marketing materials
- Keep documentation current
Remember: Always prioritize user experience and SEO when changing URL structures. The simplest solution is often the best unless you have specific technical requirements.