Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

An even better solution is:

location / { try_files $uri $uri/ @rewrite; } location @rewrite { rewrite /(../)? /$1index.php?$args; }

because we had some special location rules for catalog|checkout|customer. The problem being that thay all referenced @rewrite - this way we had to rewrite ALL the location commands that were set-up to also have a separate match for /en and later /fr and /de .....

So we came up with the simplest fallback rewrite that test first for / and then for /(two-letter code) .... and rewrites based on that

seems to work fine

In addition the store_code lookup needs to be altered. Because of the /en the http_host variable or server variable do no longer work.

A possible solution can be found here: http://stackoverflow.com/questions/30078679/nginx-conf-w-multiple-maps-to-same-variablehttps://stackoverflow.com/questions/30078679/nginx-conf-w-multiple-maps-to-same-variable

An even better solution is:

location / { try_files $uri $uri/ @rewrite; } location @rewrite { rewrite /(../)? /$1index.php?$args; }

because we had some special location rules for catalog|checkout|customer. The problem being that thay all referenced @rewrite - this way we had to rewrite ALL the location commands that were set-up to also have a separate match for /en and later /fr and /de .....

So we came up with the simplest fallback rewrite that test first for / and then for /(two-letter code) .... and rewrites based on that

seems to work fine

In addition the store_code lookup needs to be altered. Because of the /en the http_host variable or server variable do no longer work.

A possible solution can be found here: http://stackoverflow.com/questions/30078679/nginx-conf-w-multiple-maps-to-same-variable

An even better solution is:

location / { try_files $uri $uri/ @rewrite; } location @rewrite { rewrite /(../)? /$1index.php?$args; }

because we had some special location rules for catalog|checkout|customer. The problem being that thay all referenced @rewrite - this way we had to rewrite ALL the location commands that were set-up to also have a separate match for /en and later /fr and /de .....

So we came up with the simplest fallback rewrite that test first for / and then for /(two-letter code) .... and rewrites based on that

seems to work fine

In addition the store_code lookup needs to be altered. Because of the /en the http_host variable or server variable do no longer work.

A possible solution can be found here: https://stackoverflow.com/questions/30078679/nginx-conf-w-multiple-maps-to-same-variable

added 270 characters in body
Source Link
snh_nl
  • 5.5k
  • 13
  • 70
  • 135

An even better solution is:

location / { try_files $uri $uri/ @rewrite; } location @rewrite { rewrite /(../)? /$1index.php?$args; }

because we had some special location rules for catalog|checkout|customer. The problem being that thay all referenced @rewrite - this way we had to rewrite ALL the location commands that were set-up to also have a separate match for /en and later /fr and /de .....

So we came up with the simplest fallback rewrite that test first for / and then for /(two-letter code) .... and rewrites based on that

seems to work fine

In addition the store_code lookup needs to be altered. Because of the /en the http_host variable or server variable do no longer work.

A possible solution can be found here: http://stackoverflow.com/questions/30078679/nginx-conf-w-multiple-maps-to-same-variable

An even better solution is:

location / { try_files $uri $uri/ @rewrite; } location @rewrite { rewrite /(../)? /$1index.php?$args; }

because we had some special location rules for catalog|checkout|customer. The problem being that thay all referenced @rewrite - this way we had to rewrite ALL the location commands that were set-up to also have a separate match for /en and later /fr and /de .....

So we came up with the simplest fallback rewrite that test first for / and then for /(two-letter code) .... and rewrites based on that

seems to work fine

An even better solution is:

location / { try_files $uri $uri/ @rewrite; } location @rewrite { rewrite /(../)? /$1index.php?$args; }

because we had some special location rules for catalog|checkout|customer. The problem being that thay all referenced @rewrite - this way we had to rewrite ALL the location commands that were set-up to also have a separate match for /en and later /fr and /de .....

So we came up with the simplest fallback rewrite that test first for / and then for /(two-letter code) .... and rewrites based on that

seems to work fine

In addition the store_code lookup needs to be altered. Because of the /en the http_host variable or server variable do no longer work.

A possible solution can be found here: http://stackoverflow.com/questions/30078679/nginx-conf-w-multiple-maps-to-same-variable

Source Link
snh_nl
  • 5.5k
  • 13
  • 70
  • 135

An even better solution is:

location / { try_files $uri $uri/ @rewrite; } location @rewrite { rewrite /(../)? /$1index.php?$args; }

because we had some special location rules for catalog|checkout|customer. The problem being that thay all referenced @rewrite - this way we had to rewrite ALL the location commands that were set-up to also have a separate match for /en and later /fr and /de .....

So we came up with the simplest fallback rewrite that test first for / and then for /(two-letter code) .... and rewrites based on that

seems to work fine