Hello community,
I am currently using web flow as my website builder and for the time being embedding Ecwid code into my website. Though using Ecwid it does not provide clean urls. They have a work around that involves placing specific code into the .htaccess file. though I cannot access the .htaccess file within web flow.
Here is the code, and what could I possibly do to take care of this?
1 — How to enable clean URLs on the “shop.html” page in the web root directory
Let’s say you added your Ecwid store to the “shop.html” file on your server and it’s available on your site via “example.com/shop.html” URL.
You now want to enable clean URLs on that page so that the store pages URLs will look like this:
example.com/shop/My-Product-p123
example.com/shop/My-Category-c123
Assuming your site structure looks like this:
- [www]
- .htaccess
- shop.html
You’ll enable clean URLs in two steps:
Map all “shop/something” pages to shop.html in the .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^shop/.*$ shop.html
</IfModule>
Turn on clean URLs in your store integration code in the shop.html file:
<script>
window.ec = window.ec || {};
window.ec.config = window.ec.config || {};
window.ec.config.storefrontUrls = window.ec.config.storefrontUrls || {};
window.ec.config.storefrontUrls.cleanUrls = true;
window.ec.config.baseUrl = '/shop';
</script>
<... Here goes the store integration code ...>
That’s it. Now open your store, navigate to any product page and refresh the page in your browser. Both navigation and page opening after refresh should work fine and you should see the new clean URLs enabled.