News:

Looking for documentation? Take a look on our wiki

Main Menu

Add to cart only works without www prefix

Started by muzoid, April 09, 2012, 06:41:20 AM

Previous topic - Next topic

muzoid

hi! 
I'm using Virtuemart 2.0.2 and Add to cart only works without www prefix.  In virtuemart admin panel, my shop URL is written with the prefix...quite lost here...
any clue?


jenkinhill

Looks like something to do with the host environment. I notice that even if a product page is accessed using www. your product image urls do not include www. 

I believe one other has reported a similar problem.This workaround there was to add .htaccess to the Joomla root to force all urls to not use the www. prefix. Thus even if a vistor adds www. in the url when accessing the site it will be stripped out before they get to buy something.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

PRO


muzoid

#4
thanks a lot both of you for the quick reply...I've tried it but then got a 500 error...I don't know if my code is good though...is it OK?

Options +SymlinksIfOwnerMatch

RewriteEngine on

# Redirect addresses which are not hostname.com
RewriteCond %{HTTP_HOST}   !^\hostname\.com$ [NC]
RewriteRule ^(.*)$         http://hostname.com/$1 [R=301,L]

PRO

Quote from: muzoid on April 09, 2012, 16:39:10 PM
thanks a lot both of you for the quick reply...I've tried it but then got a 500 error...I don't know if my code is good though...is it OK?

Options +SymlinksIfOwnerMatch

RewriteEngine on

# Redirect addresses which are not bisbeeoliveoil.com
RewriteCond %{HTTP_HOST}   !^\bisbeeoliveoil\.com$ [NC]
RewriteRule ^(.*)$         http://bisbeeoliveoil.com/$1 [R=301,L]


I meant is a redirect already in there.

muzoid

#6
problem solved with this code :

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.hostname.com [NC]
RewriteRule ^(.*)$ http://hostname.com/$1 [L,R=301]

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum