Post by TechWizard » Wed Apr 11, 2018 5:49 pm

Around 12 months ago, our organisation re-branded and we changed our main website url to reflect this from http://bmsgh-shop.org.uk to https://midland-ancestors.shop

I have set up bmsgh-shop.org.uk as an alias in my cPanel configuration so that all the links from google and our partners are still active. This appears to work, however, when you try and add to cart from an aliased link, such as: http://bmsgh-shop.org.uk/WARP148D-Rowin ... -Registers
I get an error message:

error
undefined

It's also worth noting that the old links didn't use the https:// protocol but even when trying https://bmsgh-shop.org.uk/WARP148D-Rowi ... -Registers I still get the same problem. Here is the working link:
https://midland-ancestors.shop/WARP148D ... -Registers

Is there a rewrite rule/condition that I can use in .htaccess to resolve this? And is that the best way of dealing with the issue?

Newbie

Posts

Joined
Sat Jan 13, 2018 9:44 am

Post by synapseindia » Wed Apr 11, 2018 8:38 pm

Hi TechWizard,
We have checked that your website URL is - https://bmsgh-shop.org.uk/WARP148D-Rowi ... -Registers
AND
when you click on "Add to cart" button . It is posting data to https://midland-ancestors.shop/index.ph ... t/cart/add
Please check the same in Add to cart javascript function on product.tpl file. is it custom or check the same in Store URL.

Thanks.

User avatar
Active Member

Posts

Joined
Thu Apr 05, 2018 2:27 pm

Post by paulfeakins » Thu Apr 12, 2018 5:47 pm

TechWizard wrote:
Wed Apr 11, 2018 5:49 pm
Around 12 months ago, our organisation re-branded and we changed our main website url to reflect this from http://bmsgh-shop.org.uk to https://midland-ancestors.shop
The answer is that you should use "redirects" NOT "rewrites".

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by TechWizard » Mon Apr 23, 2018 9:30 pm

Thank you for your responses.

Looking at it, I think this is likely to be more of a server related issue rather than with OpenCart.

@synapseindia I see that it is posting data to midland-ancestors.shop, which is correct because that's where the files are stored, and the other domains are aliased to this. I get the following error:

Code: Select all

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://midland-ancestors.shop/index.php?route=checkout/cart/add. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
So, I guess this is a security issue because as far as the javascript is concerned it's accessing a remote resource.

@paulfeakins The issue with redirects is that I cannot get wildcards to work. I need the subpages/SEO links to also be redirected. I could only get it to redirect the root URL. I actually have it set up as an aliased redirect (see attached image). Info here:
https://documentation.cpanel.net/displ ... cs/Aliases
https://documentation.cpanel.net/displa ... /Redirects

Thanks again for your input. I'll contact my hosting company to see if they have any suggestions. I'll post my results here so others can benefit if they have a similar issue.

Attachments

180423-bmsgh-aliasing.png

cPanel Screenshot - 180423-bmsgh-aliasing.png (73.17 KiB) Viewed 579 times


Newbie

Posts

Joined
Sat Jan 13, 2018 9:44 am
Who is online

Users browsing this forum: nonnedelectari, pipoy and 280 guests