1

I have a problem with subdomain on nginx server. In our project, we need create different urls for different store views. For example: main url: site.com url for english store: site.com/en

I implemented next solution: in root folder created new directory "en", where moved index.php and .htaccess files. For English store view for secure and unsecure section I add new Base Url and Base Url link configuration http://site.com/en/. For other 3 leave http://site.com/.

Because our live site on nginx server I add for each store new option:

location /en {
  #rewrite ^/en.html /en/ permanent;
  index index.php;
  try_files $uri $uri/ /en/index.php;
}

Everything works good, but when I make search on site (like site.com/en/catalogsearch/result/?q=opening+hours)it doesn't work. I made some researching and examined that in Mage_CatalogSearch_Helper_Data file in getQueryText() action array $_GET is empty. I think that I have wrong nginx configuration, because on local machine (on Apach)everything works good. Can anybody help me, please? Thanks in advance.

  • Thank you, @Serpyre, that is a neat summary and one I shall remember. – clockworkgeek Sep 14 '14 at 16:58
1

Solved this problem. Solution was next: need to rewrite

location /en-us {
    #rewrite ^/en-us.html /en-us/ permanent;
    index index.php;
    try_files $uri $uri/ /en-us/index.php;
}

to

location /en-us {
    #rewrite ^/en-us.html /en-us/ permanent;
    index index.php;
    try_files $uri $uri/ /en-us/index.php?$args;
}

Just add ?$args part in last line and $_GET params will be visible. Hope, this solution help somebody.

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.