Forum Moderators: phranque

Message Too Old, No Replies

help with .htaccess rewrite rules - FF add to cart problem

         

greenparrot

11:58 am on Mar 23, 2010 (gmt 0)

10+ Year Member



Recently we have encountered a problem with adding to cart in FF, on the following Joomla & Virtuemart website. This is what i know

http://www.example.co.uk/shop.html?page=shop.browse&category_id=28 - works


http://www.iexample.com/shop.html?page=shop.browse&category_id=28 - fails


http://example.com/shop.html?page=shop.browse&category_id=28 - fails


http://example.co.uk/shop.html?page=shop.browse&category_id=28 - fails


URLs missing the www part or with .com extension fail, i think, because FF doesn't like cross domain scripting. For the moment i have disabled the AJAX add to cart functionality. Now all URLs work, after adding to cart they are taken to shopping cart page.

As a better solution i need help with Rewrite rules. How do i add a rule to .htaccess so www is added to urls missing it and .com is converted to .co.uk?

Thanks for any help

Roy

[edited by: jdMorgan at 12:53 pm (utc) on Mar 23, 2010]
[edit reason] example.com, example.co.uk -- Please see TOS and Charter [/edit]

greenparrot

12:20 pm on Mar 23, 2010 (gmt 0)

10+ Year Member



I've got a little confused here

The domain is hosted on example.com, example.co.uk is forwarded to it, the search engines have iwsteamrailway.co.uk listed.

So i still need a rule to add www to url but now, i think, i need .co.uk rewritten to .com

Roy

[edited by: jdMorgan at 12:54 pm (utc) on Mar 23, 2010]
[edit reason] example.com, example.co.uk -- Please see TOS and Charter [/edit]

jdMorgan

1:02 pm on Mar 23, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please post your best-effort code as a basis for discussion. If this request is not clear, please refer to our Apache Forum Charter.

I also strongly suggest that you inspect the HTTP headers returned for requests to example.co.uk, so as to precisely-define the meaning of "example.co.uk is forwarded to example.com" -- If this is simply a domain-to-IP-address DNS mapping or if it is a 301 redirect, then all is well. However, if it is a 302 (or other) redirect, serious search ranking problems may result.

The "Live HTTP Headers" add-on (or similar) for Firefox/Mozilla will be helpful in this regard, and is recommended "basic kit."

There are two basic methods for domain canonicalization, with hundreds of previous threads discussing each or both: You can redirect all "wrong" domains to the "right" domain, or you can redirect all "not right" domains to the "right" domain. The difference may appear to be subtle, but the second method also redirects all "wrong" subdomains, whereas the first does not.

If you have secure (HTTPS) pages on this site, please mention that fact, as it affects the required solution.

Jim