I want every access to my page situated at www.mysite.com/nouveauSite/shop.html to be redirected to the same url with locale=fr added to the query string.
I can see 3 types of requests:
- Url with no query string:
/nouveauSite/shop.htmlshould be rewritten to/nouveauSite/shop.html?locale=fr - Urls with a query string, but no
localeparameter:/nouveauSite/shop.html?foo=3should be rewritten to/nouveauSite/shop.html?locale=fr?foo=3 - Urls with a query string containing the
localeparameter set to something other thanfr:/nouveauSite/shop.html?foo=3&locale=enshould be rewritten to/nouveauSite/shop.html?locale=fr&foo=3
Right now I only have number 2 working. I am using this rule:
RewriteCond %{QUERY_STRING} !locale=
RewriteRule ^shop.html /nouveauSite/shop.html?locale=fr [R,L,QSA]
I thought this rule:
RewriteCond %{REQUEST_URI} ^/nouveauSite/shop.html
RewriteRule ^shop.html /nouveauSite/shop.html?locale=fr [R,L]
would fix number 1, but it does not seem to work.
I don't know what to do for number 3.