Question

This issue only happens once the site has been deployed to Production Server. On Development Environment works as expected.

Using Magento 1.6.2.0 CE, Locale: español (Spanish)

Search works just fine on Development Environment when using search terms that contain special characters (latin characters in this case: á, é, í, ó, ú, ñ, etc.), but when website is moved to Production Server, search breaks with special characters.

Everything else seems to be working fine, I haven't found any other encoding issue so far.

I tried adding AddDefaultCharset UTF-8 to .htaccess file with no avail.

I don't think it's a server configuration issue, because Production Server hosts other websites (mostly Joomla!) that fully support special characters in search terms.

For reference try to search for term with special characters like "brócoli" on http://caserisimo.mx

On Development Environment:

Development Environment

On Production Server:

Production Server

Any ideas?

Your help will be much appreciated.


** UPDATE **

I use a 301 redirect in .htaccess for URL trailing slashes removal with directives:

RewriteCond %{request_method} ^GET$
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule ^(.+)$ %1 [L,R=301]

Thanks to @MatthiasZeis great suggestion, I added the NE flag to the last directive, so now the RewriteRule is:

RewriteCond %{request_method} ^GET$
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule ^(.+)$ %1 [L,R=301,NE]

Works as expected now!

Était-ce utile?

La solution

The first thing I noticed was that the search returns an 301 redirect with the HTTP header Content-Type: text/html; charset=iso-8859-1 and the wrong URL http://caserisimo.mx/catalogsearch/result?q=br%25C3%25B3coli.

Your search result page has the correct UTF-8 content type. I guess you want to find out where that redirect is coming from.

Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange
scroll top