Any htaccess experts about?

I can normally work this stuff out eventually, but this one has me stumped.

I need to insert store/into a URL when it’s clicked on a page.

For instance, the link on the page is…

https://demos.caffeineinjection.com/simplestore/#!/shirts/casual-shirts/blue-casual-shirt-11.html

But I want it to point to…

https://demos.caffeineinjection.com/simplestore/store/#!/shirts/casual-shirts/blue-casual-shirt-11.html

There are a few such links on the page, so I can’t change the precise URL via the htaccess doc, I need to change any URL’s that contain /simplestore/#! to /simplestore/store/#!

I thought a pretty simple rewrite would work, but it’s not.

Anyone able to help?

Have you tried something along these lines?:

RewriteEngine on
RewriteBase /

# redirect to /store if not rewritten internal
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{REQUEST_URI} !^/?store(/.*)?$
RewriteRule ^/?(.*)$ /cms/$1 [R=301,L]

# rewrite to root directory if URL starts with /store
RewriteCond %{REQUEST_URI} ^/?store(/.*)?$
RewriteRule ^.*$ %1 [L]

Thank you, but no, that didn’t work. It is redirecting to the root.

But, it’s just occurred to me the URL is being generated by javascript, so I’m pretty sure an htaccess doc can’t rewrite it anyway.