Clean store URLs

Improve store SEO with these tools.

When you add Ecwid store to a custom CMS or website, store URLs have a hash part, for example: https://www.mysite.com/store/#!/My-Product/p/123/category=0

Clean store URLs allow you to change the look of your URLs to a more clean format like:
https://www.mysite.com/store/My-Product-p123

Ecwid has a broad variety of official integrations with CMS platforms like Wix, WordPress, Squarespace, Joomla, etc. Our official integrations support all features like Clean URLs and static store pages out of the box. Find all available integrations and detailed instructions in our Help Center.

How to enable SEO-friendly URLs

Step 1. Configure your server: add URL rewrite rules

In the SEO friendly URL scheme, Ecwid places a page title right after the store page path in the URL, so that it looks like a subdirectory: www.mysite.com/store/My-Product-p123 .

On the other hand, this is just a page on your server, not a directory. So if the server will try to find something inside the store page, it will fail and return 404 errors. To make your server properly process these URLs, you will need to configure URL rewrite rules.

The general rule is to map everything after slash on the store page to the store page itself, i.e.:
www.mysite.com/store/anythingwww.mysite.com/store

Specific configuration depends on your server:

See example codes for Apache

Example rule for Microsoft IIS:

<rule enabled="true">
<match url="^shop/.*$" />
<action type="Rewrite" url="shop/" />
</rule>

🚧

Do not redirect the "store/anything/" to "/store" . The rewrite rules should only map one URL to another, without redirection. If you redirect the visitor to the /store page instead, the store pages will not be properly indexed by Google.

Step 2. Adjust Ecwid integration code: enable the SEO URLs

On the site page where you add Ecwid store, you will need to add a few lines of javascript code before the Ecwid integration code. It will tell Ecwid to enable SEO friednly URLs on this page. See example codes

Make sure to replace the "/store" dummy value in the last line with the actual store page path. Ecwid will use this as a base for the clean URLs. E.g. if you specify this URL as your base URL: /subfolder/shop and your site is on https://www.mysite.com

Ecwid will address store pages like this:

  • https://www.mysite.com/subfolder/shop/My-product-p123
  • https://www.mysite.com/subfolder/shop/cart
  • https://www.mysite.com/subfolder/shop/checkout

etc.

📘

We recommend using relative URLs in the baseUrl parameter. But you can also specify an absolute baseUrl if needed, e.g. "https://www.mysite.com/subfolder/shop/cart".

In such case, make sure it is under the same domain a visitor browses the site. E.g. if it includes 'www', do include 'www' in the base URL; if it contains https, do use https in the base URL. If the base URL domain or schema differ from the actual ones, the visitor browser will block URL rewrites and the SEO URls will not work.

Examples

Please see the example codes on this page

FAQ

Q: Will the regular hash-bang URLs continue working if I enable the new SEO URLs?

Yes, the old URLs will be supported, so if someone clicks the old link anywhere on the web, they will get to the corresponding store page. Upon opening the page, Ecwid will automatically replace the hash part so that the visitor will see the new URLs in the browser address bar.

Q: Can I get SEO-friendly URLs in Ecwid REST API?

Yes, when getting information about products and categories in an Ecwid store, you can choose the URL format you wish to receive in response. Use the cleanUrls=true parameter when getting products or categories.

Q: How can I improve SEO if I can't change the server settings?

The enabling of the SEO-friendly URLs involves modification of the server settings and some website owners simply can't access it sometimes. The query-based clean URLs is a workaround for this situation – all you need to enable them is to modify the Ecwid integration code (ignoring the Step 1 and 2 of SEO-friendly URLs)

Query-based clean URLs for Ecwid allow to change the store URLs so that they look like this: https://www.example.com/shop?store-page=Apple-p123 thus improving the SEO standings of the store pages, but without any changes to the server configuration.

How to enable query-based clean URLs

On the site page where you add Ecwid store, you will need to add a few lines of javascript code before the Ecwid integration code. It will tell Ecwid to enable query-based URLs on this page. See example code

If the baseUrl is specified, Ecwid will use this as a base for the query-based URLs. It is an optional field that is helpful when you want to have a permanent query parameter when a customer browses the store. In other cases, we suggest not using it in your code.