What Would Cause html?sef_rewrite=1 in URL?

In looking through my stats today I noticed that someone landed on a page like this:



[url]http://www.mysite.com/my-product-name.html?sef_rewrite=1[/url]



What would cause this and how do I stop it?

Actually, upon further testing, I see that all my URLs that are being redirected from my old shopping cart to CS-Cart are doing this. In other words, when someone requests:



[url]http://www.mysite.com/my-product-name.php[/url]



my .htaccess 301 redirect sends them to:



[url]http://www.mysite.com/my-product-name.html[/url]



but for some reason ?sef_rewrite=1 is being added.



Help!

Also, I notice that this has only started happening TODAY! Weird. If I look at yesterday’s statistics (and before), there are no sef_rewrites in my URLs. What could have changed?

my stats have shown this for a long time, I’m not sure why it shows in the url but my pages load fine so I’m not too worried about it…

?sef_rewrite=1 generated with incorrect / wrong redirect



For example:

Redirect 301 /category.html http://www.domain.com/category/



Good example (working with cs-cart):

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




below


RewriteBase /

I’m experiencing the same problem, I’ve sucessfully move the cart from a previous cart and all urls are now updated but all feature sef_rewrite=1



The old categories had a stucure of /shop/1/2/3/ whats the best way to 301 these as I get a 500 server error.



Thanks

Here is the reply I got from CS-Cart support helpdesk:


[QUOTE]The “?sef_rewrite=1” code was added to your links due to the conflicts between the “Redirect” option added by and the standard rewrite rules in “.htaccess” file of CS-Cart. These rules are added in order to provide the functionality of the “SEO” addon.

Please let me note, that there is no problem when using the standard “.htaccess” file.

I can offer you to replace this part of the code (as an example) in your “.htaccess” file:

RedirectMatch permanent ^/product-page.php$ [url]http://www.domain.com/product-page.html[/url]



with this one:

RewriteCond %{REQUEST_URI} ./product-page.php

RewriteRule ^.
$ [url]http://www.domain.com/product-page.html[/url] [L,R=301]



and place it before this part of the code:

RewriteBase /



In this case the “?sef_rewrite=1” code will not be added to your links.

These changes work with all URLs in standard CS-Cart.

But please let me note, that these changes do not work for URL with any parameters at the end of the link in your case (for example product-page.php?pg=2)[/QUOTE]



I think this is the same as Darius mentions above, though support tells me to put RewriteBase/ under the redirects, whereas Darius says to put it above. I am busy re-doing all my thumbnail images at the moment, but when I get done with that, I will test this solution to see how it works out.

Looking at Darius’s redirect makes me want to raise another point.



I personally feel in the first place CS-cart should not have permanently fixed the SEO function such that the “.html” extension is necessary. (It was not that way in v1.3.5, where the “.html” can be commented off and the SEO still works fine).



The “.html” extension is really quite old-schooled. And one of the criteria for search engines SEO besides readable URLs is that the shorter the URL’s the higher the natural rank.



Almost all SEO rewrites in CMS nowadays do not ends with an extension since pages are generated dynamically nowadays.

But well just my personal opinion.



Back to the thread’s point, I’ve added this rewrite rule to my htaccess to prevent exploits, since I’ve noticed this particular exploits attempts in the error logs of my site, and just want to redirect it away without it having to even register in my error logs.


RewriteBase /

#PREVENT QUERY STRING EXPLOITS
RewriteCond %{QUERY_STRING} mosConfig [NC]
RewriteRule ^(.*)$ - [F,L]


But unfortunately, it also create this sef_rewrite=1 problem for me.

[quote name=‘nodame’]

I personally feel in the first place CS-cart should not have permanently fixed the SEO function such that the “.html” extension is necessary. (It was not that way in v1.3.5, where the “.html” can be commented off and the SEO still works fine).

[/QUOTE]



Page cannot be accessed as

/category/

/category

/category.html



This is wrong, a duplicate page generator, main reason for low serps



A way to select this in seo mod would be great.

Did anybody have any solution for this redirecting extra code been added to the urls



please share with us.



many thanks

[COLOR=“DarkOrchid”]I have one even better. My current urls are showing up like this in the SE crawls:[/COLOR]

[COLOR=“Red”]/beach-bungalow-birdhouse-centerpiece-pr-17715.html?sef_rewrite=1¤cy=USD[/COLOR]



[COLOR=“DarkOrchid”]I know all this is killing my SEO. I am now seeing almost all the pages crawled with currency coding after it like this. I REALLY need some help ! PLEASE[/COLOR] :confused:

DawnG , I can try your FTP because i have solved mine :slight_smile: info@thewebdevelopmentservices.com




[quote name=‘DawnG’][COLOR=“DarkOrchid”]I have one even better. My current urls are showing up like this in the SE crawls:[/COLOR]

[COLOR=“Red”]/beach-bungalow-birdhouse-centerpiece-pr-17715.html?sef_rewrite=1¤cy=USD[/COLOR]



[COLOR=“DarkOrchid”]I know all this is killing my SEO. I am now seeing almost all the pages crawled with currency coding after it like this. I REALLY need some help ! PLEASE[/COLOR] :confused:[/QUOTE]

[quote name=‘info@web-host-india.com’]DawnG , I can try your FTP because i have solved mine :slight_smile: info@thewebdevelopmentservices.com[/QUOTE]



Why you need a ftp from somebody, why you arent share here the solution?

Because solution is listed in this page only already , and you are unable to see it :slight_smile:


another indian spammer or scam site?

I also have this too, but it's a very strange one.



I have redirects set up in .htaccess like so:


redirect 301 /products/Product-Name.html http://www.domain.com/product-name.html

and

redirect 301 /categories/Category-Name/ http://www.domain.com/category-name/



However, both these produce “?sef_rewrite=1” at the end of the URL's.



I have had to use a php redirect to redirect Uppercase characters in the URL to Lowercase, because, without it, the redirects above work like this:


/products/Product-Name.html redirects to http://www.domain.com/Product-Name.html



This is not valid and produces a 404. With the strtolower php function, I can get this to output .com/product-name.html - but only at the expense of adding “?sef_rewrite=1” to the end of URL's.



CS-Cart support have recommended:



RewriteCond %{REQUEST_URI} .*\/categories\/Category-Name\/
RewriteRule ^.*$ http://www.domain.com/category-name/ [L,R=301]




This is in effect doing the same job as the redirect above, however, I would have to do this for every category/product URL.



I would much prefer, in the same 'working' format which CS-Cart have provided, a way to strip '/category' and '/products' AND convert uppercase to lowercase, or at least find a reason why CS-Cart is making these redirects go from .com/category-name/ to .com/Category-Name/ and causing a 404 error.



Any ideas?

I believe it is because it's not finding 'category-name' as an SEO name that relates to a category. Just a guess.

[quote name='tbirnseth' timestamp='1322001125' post='126573']

I believe it is because it's not finding 'category-name' as an SEO name that relates to a category. Just a guess.

[/quote]

That's what I was thinking, but I can't enter the relevent Dispatch Value and SEO Name into Website>SEO Rules, nothing happens.



I tried:

Dispatch Value

/categories/Category-Name/

SEO Name:

category-name/



When I save, it changes the SEO Name to 'category-name-en'



Yet it still produces domain.com/category-name?sef_rewrite=1





CS-Cart say this will be a custom development job - it does leave me wondering how they expect their potential customers to move from an existing cart to CS-Cart.

It will append the '-en' if there's another entry of the same 'type' with the same 'name'. Look it up in cscart_seo_names and then go find the item it refers to. If it's valid then all is well. If it's not, manually delete the entry and save the item again.

Same thing happened to me. All my 'preview' page links plus 'preview' new products went straight to my home page

When I hovered over the preview link I would see

https://www.mydomain...te-windows.html at the lower left ( which looked weird of itself )

yet when I clicked I was taken to my home page

https://www.mydomain.../?sef_rewrite=1

All the solutions in this thread messed with my head and as I only have

3 main product lines I disabled the SEO add on and all is well now.