Jump to content



Member Since 03 Oct 2011
Offline Last Active Mar 21 2012 11:07 PM

Topics I've Started

Missing trailing slashes in URL are causing duplicate content issue

23 November 2011 - 09:37 PM


These two urls are returning server response 200 OK, and are therefore considered TWO distinct separate pages:

Both are obviously resolving to the same category page in my cart, but this is causing:

1 - Google to warn me of duplicate content in GWT, and
2 - splitting of page rank, PR, and links between these 2 urls, making each less relevant.
3 - traffic in GA is also split, clearly indicating Google is treating these urls as distinct.

To avoid both page dilution, and potentially severe content duplication penalties, I am trying to enforce the use of the trailing slash for all directories throughout my site, and this is
what I've done so far:

Elsewhere in my site (besides the store directory), I've resolved this issue easily with the following htaccess redirect

RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*[^/])$ /$1/ [L,R=301]
that I've added to my root htaccess, and also to the htacess files in each directory (if a directory has one). As a result, if someone types in


in their browser, then the url is automatically changed to

mydomain/somedir/ (with the slash),

as the page is redirected. And I get these server responses:

mydomain/somedir   ==> 301 redirected to    mydomain/somedir/
mydomain/somedir/  ==> 200 OK
which are exactly the right responses I should get. So my site in general is in great shape and not having duplicate content issues,


for the cart categories, that don't seem to obey the htaccess above that works perfectly elsewhere.

I've been pulling my hair looking for a solution to this, and would appreciate any advice please.

More details:

a) - as you see above, I have the store in a directory, not at the root of my site. At the same level of the store I have other directories, all obeying the htaccess directive and not creating any duplicate issue. Examples:

mydomain/anydir/subdir1                   redirects to: mydomain/anydir/subdir1/
mydomain/another-dir/subdir2              redirects to: mydomain/another-dir/subdir2/
mydomayn/yetanotherdir/subdir3/subsubdir  redirects to: mydomay/yetanotherdir/subdir3/subsubdir/
mydomain/cscartstore                      redirects to: mydomain/cscartstore/ ( ==> up to here the htaccess redirect works fine)
mydomain/cscartstore/a-category           DOES NOT redirect at all and shows the "A Category" page under url without trailing slash

b ) - I am using the SEO addon, and in it I've chosen to display categories as /category/ That is working fine from links within the cart, so for instance if I go to the menu and select a category, it will show correctly with the "/" as in


c) - HOWEVER, if someone links to this category from their own site and forgets the trailing slash (which is not only common, but beyond my control in many cases), as in


then Google will eventually crawl that link back to my store and index this url without the trailing slash, failing to identify it with the one having the trailing slash. And that's the source of my content duplication issues. So even though I am being consistent in my internal links, sitemap, etc, this issue still appears and I need to address it.

d) - Besides the htaccess redirect (which is not working for CS-Cat categories only), another solution is to use a canonical tag in the "head" section of every single category page, redirecting the "non-/" to the "/" url version. There are 3 issues with this solution:

1 - Google does not necessarily follows (respect) canonical tags as they would a htaccess 301 redirect

2 - Google may not notice the "/" at the end of the canonical url (web reports are conflicting on this) and therefore not see the difference in this one particular redirecting circumstance, although separating "non-/" from the "/" urls for other purposes - such as when indexing, for example. (and yes, Google is not consistent in their approach of this situation, as even they admit).

3 - This canonical redirect would need to be done automatically, by adding code in the head section of the page-creating template, such as this:

<link rel="canonical" href="{page_url}">
that would become, in the html page created for a category named (let's say) "A Category":

<link rel="canonical" href="http://mydomain.com/cscartstore/a-category/">

So if you do know how to implement this, and would like to contribute information or code, then your contribution will be highly appreciated by me and others in this circumstance and I thank you in advance.


Access denied: CSRF attack ?

06 November 2011 - 05:02 PM

Well, just for fun I thought I would increase store security a bit by turning on this switch in config.local.php:

'anti_csfr' => false, // protect forms from CSFR attacks (experimental)

'anti_csfr' => true, // protect forms from CSFR attacks (experimental)

That was a couple days ago, and I don't remember if I logged back in since as the Admin (or if I ever logged out, to be honest), but this morning when I tried to login instead of the admin panel I got this message in a otherwise blank page:

Access denied: CSRF attack

So I wander now if:

Is anyone here using this successfully? And how?

I know it says "experimental" and all, but a more secure site is a good thing to have.

Any advice appreciated!

(BTW, I was able to login once I turned it back to "false")

Visitors need to Filter by Product Options

16 October 2011 - 06:08 PM

How come visitors cannot filter by Product Options, only by features and a few other criteria (price, in stock, free shipping)?

Please visit this Macy's category page to quickly understand what I mean. (and YES, I love shoes!)

In this "Category" page example,

  • one of first Filters on the left side column is "Size" (a typical CS-Cart Product Option), and
  • it is displayed conveniently as small buttons (instead of a list as CS-Cart would)

I've been trying to get at least "1" (the filter) to work in my CS-Cart Pro 2.2.3 store, but can't!

It seems so basic that instead of showing visitors all products in a category as it happens now, you'd display only what in their sizes AND that you have in stock, so they can quickly find what to buy from you.

NOT having this capability means that a visitor now (in the common situation when the physical stockroom is not fully stocked with all products in all sizes at all times):

  • sees all products displayed in the category page, and then
  • has to go into a product page to find out if there is any in stock in his or her size, and if not
  • go back to category page and find another product, and then
  • repeat 1->3 until visitor finds something that fits (or more likely give up and go elsewhere)

<rant> What kind of illogical routine is that?? Making it hard and frustrating for visitors to find what to buy in your store is opposed to the whole concept of having an online store. They might as well go to a competitor who respects their time and doesn't try their patience. </rant>

So I want to allow visitors to Filter by Product Options (or more precisely, their Combinations). I guess the easiest path to accomplish that would be to "automagically" create and dynamically synchronize new Features based on Products Options (since Features can in turn be easily used to create Filters), but I know little about the structure and code of CS-Cart.

Please let me know if I am missing something easy here, or if you have any ideas on how to accomplish this.


PS - Notice I haven't even touched on Macy's feature "2" above, using buttons for filters - that is nice but not needed for "1" to work. Also notice that Macy's does the same for "Color" (down their page), another typical CS-Cart Product Option.