We recently migrated to CS Cart from Joomla/VirtueMart and need a pretty high volume of URLs redirected. Regardless of the method of redirection we use, the ?sef_rewrite=1 is appended to the URL.

I've seen a fair number of posts about this topic as well as a few folks who claim to have fixed this, but there's nothing currently in the forums that outlines the steps necessary to remove this noise from the end of the redirected URL.

Does this have something to do with canonical URLs? I've seen mention of CS Cart potentially interpreting the redirected URLs as being duplicate content also.

Thoughts? Fixes?

Generally you end up with that GET parameter when the SEO name that is requested can't be resolved in the cart.

Thanks for the reply.

What we're trying to avoid is having Google and Bing index these URLs with the appended noise (which is already happening). Here's how we're handling the redirect -

RewriteCond %{REQUEST_URI} .*\/Category/11.html
RewriteRule ^.*$ http://mydomain.com/category.html [L,R=301]

I modded the SEO add-on func.php file to account for trailing slashes (there's a fix found here in the forums) thinking that may help, but it unfortunately doesn't.

Would I be wrong in thinking that ?sef_rewrite=1 is essentially the product of a loop? Should the redirect be written with the non-SEF URL?

Not sure… The standard .htaccess file will call the cart with sef-rewrite=1 indicating that the internal rewrite engine should look up the name and resolve it to a controller/mode and maybe a REQUEST variable. If it can't find the name, I think it will generate a 404. I'm unclear as to what exactly would cause it to display the home page with ?sef-rewrite=1, but I would guess there is confusion between what you're doing manually with rewrite conditions/rules and what the cart is doing internally. Others are much more knowledgeable about rewrites here than I am.

Thanks again for replying.

I've gotten the ?sef_rewrite=1 to show up on the Home Page once. I cleared the cache via the browser and the address showed as Web Hosting, Domain Name Registration - MyDomain.com.

Frameworks like WordPress, SilverStripe, etc… will allow rewrites in the method in my reply above, and it's actually really frustrating to see a framework as robust as CS Cart fall down in this area. While this doesn't at all affect our flow of business, it's a matter of ensuring these “duplicate” or noisy URLs aren't indexed and more importantly don't show up via organic search results. It's fine for now, though as our business increases this is going to be a big thorn in our side.

So if it does boil down to an issue of rewriting with the non-SEF compliant URL, how does one find that without disabling the add-on? I'd like to at least experiment…

If it is of any help to you (seems to work for me, albeit with other .htaccess/httpd.conf rules implemented, CS-Cart support advised this is the best format to avoid “?sef_rewrite=1” being appended to URL's which are not native to the cart (ie. the URL you are redirecting from is not stored in the necessary SEO-related database table.

RewriteCond %{REQUEST_URI} .*\/old-page\/
RewriteRule ^.*$ http://www.domain.com/new-page/ [L,R=301]

Hope that helps. I would also advise signing up for Google Merchant Center and Webmaster Tools if you haven't already, and add “?sef_rewrite=1” as an identifier to ignore, thus, Google ignores it and will index the URL as “domain.com/page-name/” instead of “domain.com/page-name/?sef_rewrite=1” - most of my issues with this are now resolved with only a few URL's still indexed including the sef_rewrite tag appended to the URL's. The canonical URL's addon, combined with the trailing slash edit you previously mentioned, will also help.

Hey Stellar,

Thanks so much for chiming in.

At a glance, it doesn't appear as though your code example differs all that much from mine. If there's something I'm missing please let me know.

We are signed up for the Webmaster tools and while we added exceptions/blocks for the weirdo URLs Joomla/VirtueMart often produce, we still saw them indexed and it has been a PITA. Joomla/VirtueMart does produce duplicate content, so part of our move to CS Cart was to engage our customers with a smarter system. As for Google Merchant, my understanding is that a lot of that functionality is going away in favor of Google Wallet. If you're aware of something different, please let me know.

To break this all down - there is no way to prevent CS Cart from appending ?sef_rewrite=1 to any redirected URL. The best way to attack this is to stay on top of the SEO and ensure the appended thingamadoo is blocked so everything is correctly indexed. We professionals often hold our cards close to our chest and since this is a topic that has been open for some time in the forums (across multiple posts dating back to 2008), let's please put this to rest and proffer a definitive solution for future users.

How does one mitigate backlinks when ?sef_rewrite=1 appears in the users browser and they copy/paste the URL? Bing and Google index these regardless, so what luck have you had ensuring your URLs display in a manner you're satisfied with (i.e. clean)?

Hello m33!

Did you solve the problem with [color=#282828][font=arial, verdana, tahoma, sans-serif][size=4]/?sef_rewrite=1 ? If yes, please, share your solution :)[/size][/font][/color]

The easiest solution to 'fix' it is to create your redirects to redirect to the non-SEO friendly URL (eg. index.php?dispatch=page_id=7) which will redirect your old URL from 'my-old-page.html' to 'my-new-page.html' without the 'sef_rewrite', in the URL, however, this defeats the purpose of creating the 301 redirect in the first place and will cause an indefinite loop in some server setups.

Use canonical URL's to avoid indexing of 'sef_rewrite' in the URL, something simple like this would do the job, add this within the of the document (enable my_changes addon and place code in /skins/yourskin/customer/addons/my_changes/index/meta.post.tpl):

Or spend some money and do it the more advanced way: Canonical URL Addon (The extra functionality of being able to create your 301 redirects within the cart makes this addon a worthy addition in itself!)

Thanks! Installed the addon you advised. Hope it will do the thing :)

Hi all,

Thanks very much for bumping this thread. I'm actually back on the path of having to inset more than 200 301's because of the massive changes CS Cart made to the SEO module in version 3.0.3 and higher.

We did purchase the Canonical URL addon, but ended up ditching it because it doesn't really allow administrators to create 301 redirects as advertised. It allows you to rename an SEO compliant URL, but you're not actually redirecting it (hence the addon's name, Canonical). The developers need to amend the language regarding the addon's functionality because using it made matters worse by creating invisible redirect loops and renaming products/categories arbitrarily. That said, we're right back to where we were in December of 2011 and still looking for an effective means of managing 301 and 302 redirects before Google kicks us down a notch for what will in the end be several hundred 404 errors.

Where we're at now is hand editing the .htaccess file to create the redirects and then testing them one by one to make sure they work as expected. We are running into several redirect loops that were created by the Canonical URL addon, hence the one-to-one testing of each redirect. When we find a URL with a redirect loop, I then edit the database and regress the damage done by the addon. For something that should be an extremely simple administrative task a la Drupal, WordPress, Magento, et al… it's surprising that URLs cannot be administrated inside of the core of CS Cart. The current flow is way too laborious.

A different addon that we're going to evaluate is CDSEO - [font=arial, sans-serif][size=3] [/size][/font][url=“Search results”]Search results. Anyone have experience with it? I really wish there was a “try before you buy” option for these CS Cart addons because many of them are poorly developed/planned, and I'm not really of a mind to continue throwing money at things that frankly don't function.

You can do the 301 redirect by inserting the canonical url field(the new url) for disabled category/product. We also have a modified version to allow doing this for active category/product. Just try it and let us what is your needs here.

You should be able to request a refund from any reputable cs-cart addon developer. Just do your homework. You can also look at their member status here to get an idea of how involved they've been in the forums and to get an idea of whether they provide solutions or hacks.

If all you want to do is keep track of changing SEO names and 301 to the current one, then you might want to look at our SEO History addon (Auto Mailer). Only caveat I'd give is that it may not handle path component changes well. I.e. if you had mysite.com/orig_cat_name/product.html and then changed the SEO name for orig_cat_name to new_cat_name, it will struggle to resolve mysite.com/orig_cat_name/product.html with a 301. However I do believe it will redirect there, just not with a 301. End path components like the 'product.html' are handled just fine and also when the category is the end component. It's been a while so I forget what the issue was but it became complicated to do the replacements while in recursion.

The addon will keep track of an infinite number of SEO name changes and allow you to search the standard SEO name table as well as the seo_history table. You can also delete old ones through the UI as well.

This may be off topic but Tony - your website ez-ms.com is down for the past two days. Is everything OK?

Yeah, my host (to remain nameless) in their attempt to move my VPS to new hardware sent me a note to update my nameservers to new IP addresses. Then once I got mail working again (my mail comes from this VPS) there was a note like “oops, we goofed, returning you to the old VPS”. So then the nameservers were out of sync and to make a long store short it took a while to get them to get me the right IP addresses and then for those to propagate.

I’m apparently on the new hardware and all appears to be well. At least it was a Friday and not a Monday! :-)

All should be well now.

For customers who saw a timeout (about 5 seconds) during admin login on license checks, I apologize for the inconvenience. While it may have take a little longer to get logged in, there were no effects after the login.

Thanks for checking. Kind of feels like a community out there! :-)

This resolved my [color=#282828][font=arial, verdana, tahoma, sans-serif]?sef_rewrite=1 problem. [/font][/color][color=#282828][font=arial, verdana, tahoma, sans-serif]Add this type of entry in your .htaccess in your webroot. No problems now :-)) And, I use this with with CSCart Rocks “Canonical” addon which helps mostly to remove dup product listings.[/font][/color]

/abc.html to /def.html

RewriteRule ^abc.html$ /def.html [R=301,L]

/abc and /abc/ to /def

RewriteRule ^abc/?$ /def [R=301,L]

For noobs, take out the comment "#".

As an example for most of my pages needing to be redirected from the old url to a new url so as not to loose the SEO "juice":

RewriteRule ^compressors/compressor-accessories.html$ /pneumatic-accessories/pneuline-controls-air-station-accessories.html [R=301,L]

To malvcomm

How exactly do i implement the code you provided above? I am a newbie here, and have the same problem as the person before. That is the ?sef_rewrite=1.

Please help!

This resolved my [font=arial, verdana, tahoma, sans-serif]?sef_rewrite=1 problem. [/font][font=arial, verdana, tahoma, sans-serif]Add this type of entry in your .htaccess in your webroot. No problems now icon_smile.gif) And, I use this with with CSCart Rocks "Canonical" addon which helps mostly to remove dup product listings.[/font]

# /abc.html to /def.html
# RewriteRule ^abc.html$ /def.html [R=301,L]
# /abc and /abc/ to /def
# RewriteRule ^abc/?$ /def [R=301,L]

For noobs, take out the comment "#".

As an example for most of my pages needing to be redirected from the old url to a new url so as not to loose the SEO "juice":

RewriteRule ^compressors/compressor-accessories.html$ /pneumatic-accessories/pneuline-controls-air-station-accessories.html [R=301,L]

Has anyone tried this with a more current version of CS Cart; ie 4.5?


These are Apache controls and have nothing to do with cs-cart version.

I believe the issues are consistent across cs-cart SEO rule. Cs-cart handles SEO *name* changes but does not handle SEO *rule* changes.