This isn't so much a question as a note of something to watch out for.

In CartThrob (I'm on v4.6, but it probably happens on other versions as well) if a product has one of a specific list of words in the URL, then an Ajax erquest to add the product to the shopping cart will fail with a 404 Page not found error.

The list of words is:

vip, images, interface, downloads, pdfs, system, themes

There may be more, but these are the ones I have found.

The problem is due to an entry in the main .htaccess which matches URLs with one of these words in and then performs non-content-page routing on them. This is the .htaccess entry:

RewriteCond $1 !(vip|index\.php|admin\.php|images|interface|downloads|downloads\/pdfs|system|themes|sitemap\.xml\.gz|favicon\.ico|robots\.txt|adminerTEMP\.php) [NC]
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*) /index.php?/$1 [L] 

The fix is to change the URL Title field in the Publish tab and the Structure Listing URL in the Structure tab so that they don't include these words.

Thanks to Phil at CartThrob support for helping in identifying the problem.

Hope that's useful!



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.