Help with .htaccess file for Ecwid shop site

Hi There,

I have a shop site that used Ecwid, which is great, however it creates crazy long URL’s that aren’t being crawled properly by google so none of the ‘products’ are showing up as on the site. So nobody is finding the products.

There is a way of getting Ecwid to create clean URL’s and that’s fine and works, but then the clean URLs don’t actually point to the pages so I keep getting 404’s.
The trick is to configure .htaccess so that it remaps the clean url to the shop page on the site and there’s a github post on how to do that here:

However it’s not working for me and I think it’s because the file structure that Rapidweaver uses is not the same as the file structure used in the instructions, i.e. index.php files within folders named for the page. So my ‘shop’ page is actually in /shop/index.php
I cannot for the life of me get this to work as I don’t really understand .htaccess or even what I’m trying to get it to do…

The site, with cleaned url’s is here, but if you go to any product and then reload the page you’ll get a 404…

Does anyone know how to configure .htaccess so that it does what the github article says and remaps any shop url to the actual shop page? I’m attaching a grab of my site structure too.

Thanks for any help

I don’t have a solution, but just wanted to check something…

Ecwid doesn’t produce clean and SEO friendly URL for products? Is this 1997? Surely they must? Surely the issue must be in your settings somewhere, not default?

If correct, and in 2019 an online ecommerce platform isn’t producing SEO friendly URL’s as standard, run away, very fast.

Well, it does if you use it’s own store hosting, or wordpress or joomla or muse etc. etc.
but not by default if you use a 3rd party host. However you can just add the code into the embed to generate clean ones and that’s fine.

The issue is that you need to make the outside world, and google, think the products are actually on your own site and not on the ecwid servers, and that means their clean up code doesn’t quite work. Hence the remapping

There is a work-around but it’s not as effective apparently as the url’s it produces aren’t quite as clean.

Also, their solution would work fine in a normal file structure situation. It’s because RW uses index files for every page that’s causing the glitch, which Ecwid can’t control of course

Either way, I’ve paid them now for a year so I want to get it working :-)


Are you using @Ricardo Ecwid stacks? They look to me to produce SEO friendly URL’s:

If not, Ricardo is a super helpful dev, if there is something can be done his end I’m sure he’ll do his best.

I am, but he’s travelling at the moment. He’s on it though. At the moment the clean urls aren’t implemented in his stacks. We’re in conversation about it but I wanted to figure out how to get .htaccess working as a stop-gap

Gotchya. Sorry I can’t help on the htacess thing.

Hello @rojharris,

I’ll be working on adding clean URLs to my Ecwid stacks ASAP, I return from my trip tomorrow. My plan is to have two settings, one that requires no messing with the .htaccess file and one that would, but it would be an easy change. The two options produce two different kinds of clean urls. I’ll keep you all posted on my progress. I should have this week, if not sooner, lol.

Hi @Ricardo,

Please don’t feel like I’m pressuring you. I’m not at all. This post was more about me working out where I’d gone wrong trying to edit the .htaccess file myself and failing :-)

great news that the fix is coming though. It will undoubtedly help with the Marie Laforge page too.


Hi @rojharris,

It’s all good, I can’t wait myself to implement this.
I’ll have something soon.



1 Like

Hi @rojharris and @steveb

Version 1.0.7 of Ecwid Stacks are now available, with query based cleanURLs as now the default when you use the Ecwid Customizer, even if NO options have been selected. I might add the other type of clean URLs, which would require a small edit to the .htaccess file, and the documentation on how to do it!

No changes are required to the project, except for re-publishing it.

Let me know if you have any questions.




Wow that was quick! What a great service! Thanks @Ricardo.

I’m out of the office right now but I will give it a try as soon as poss.


1 Like

Hi @Ricardo ,

The new version is great, however it’s the better, but not ‘best’ clean versions. If you do get some time I’d love to see the other type added as then you don’t get the ‘?store-page=’ part added. Even if it does mean editing the .htaccess file, I think it will be worth it for SEO purposes.

Many thanks

Assuming that is added at the end, as in… /itembrandname_itemmodelname_itemvariant_?store-page=" it shouldn’t effect SEO.

1 Like

I’ll be adding the other type of clean URLs soon. It requires a bit more testing and clear instructions on how to use it. So query based URLs are a great default option, and should not affect negatively SEO rankings.


Nah, it’s added at the front.:

Ideally it should be:

Might not impact too much on SEO though… But…Much easier to make site maps the second way and share links etc.

Actually, it’s added at the end, “?store-page=…” there has to be something after the “=”.

Ha! Yeah, sorry. I meant at the front of the last part of the url… not the front of the whole thing.

Sorry for the confusion… :-)

Wondering id something like this would do it.

Pretty URL rules

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^shop/(\S+) /shop/?store-page=$1

With the Ecwid Stacks default settings there is no need to modify the .htaccess file to accomplish clean URLs with the format /shop/?store-page=ProductName-p3278678 for example. It does all that automatically.

Hi @Scott_Williams, Thanks for this. It kind of works, but now you can put literally anything after the word shop and it will redirect back to the shop main page. for example: takes you to the main shop page :-)…

Also, if you then navigate somewhere else, it leaves the ‘fred’ part in the url, which is weird. It also means that sharing URL’s is difficult because anything will go to the shop page…

As @Ricardo says, its working now with the “?store-page=” added, which although not pretty, does work. There is a slight issue with sitemaps as we use an Ecwid app that auto-generates them ( and when you tell it to use clean URL’s it generates them without the “?store-page=” bit added, so I have to find and replace to add it back in so the map is correct. I think this is because it was designed for integrated shops, that have clean url’s automatically.

I’m now looking at changing the design of the shop so that every product has it’s own location on our site that then links to the individual Ecwid product. That way the crawlers will find them on our actual site and not need to be using redirects .

Many thanks chaps