First the disclaimer
I am not a programmer or web design.
I have coded my own websites, but there is a lot of trial and error; before they work as intended.
**The information below was acquired after a lot of testing of a lot of code on how to replace #! **
This information is being made freely available and I am not responsible if things don’t work properly or your site comes down. Always backup your site and the files mentioned below, so if something goes wrong you can restore them.
If you don’t know what you are doing do not attempt this; find some who can and let them handle it.
For The Adventurous of you out there - LET US PROCEED
This is complicated and tricky
There are several methods explained across the net and some work some don’t
You’ll need two things the code from Spreadshirt which should look something like:
< div id=“myShop” >
< a href=“YOURSPREADSHOPURL”>YOURSHOPTITLE< /a >
< /div >
< div >
< script >
var spread_shop_config = {
shopName: ‘YOURSHOPNAME’,
locale: ‘us_US’,
prefix: ‘https://shop.spreadshirt.com’,
baseId: ‘myShop’,
};
< /script >
< script type=“text/javascript”
src=“https://shop.spreadshirt.com/shopfiles/shopclient/shopclient.nocache.js” >
< /script >
< /div >
Extra spacing after < > is so that the code will show up on the post
Next comes the modification of the .htaccess file (Always backup this file before you do any modifications and upload it to your server or hosting account in case something goes wrong).
From the information I gathered the code below worked for me
If you don’t know how to do this speak with your hosting provider or someone familiar with your hosting service. It took me several days to get this to work - so I’m assuming this is not cut and dry the some sites say it is.
The following code replaces the hashbang #! with / (the forward slash)
#Script from: https://stackoverflow.com/questions/42572066/remove-hash-in-url-using-htaccess-file
RewriteEngine On
RewriteBase /
RewriteRule ^#!/(.*)$ /$1 [L,NC,R]
Then I needed to add this code as well; because the URL was breaking as the & sign on my hosting provider was being replaced with & ;
#Script from: https://stackoverflow.com/questions/34857861/how-can-i-replace-amp-with-in-my-url-via-htaccess
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(. )&(. )$
RewriteRule ^(.*)$ /$1?%1&%2 [L,R]
You can see the results at my xzendor7 website https://xzendor7.com/xzendor7-digital-art-tshirt-shop.php
Hope this helps.