WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

changing site language to browser default language

  • 1.  changing site language to browser default language

    Posted Thu April 11, 2013 04:39 PM
    Hi, I am using websphere commerce 7. I added a new language spanish to the commere server. Now i want the webserver to change the language to spanish when the browser language is spanish.

    I did some google and I added the following to the httpd.conf file.
      
    RewriteEngine on  RewriteRule ^/$ https://%{HTTP_HOST}/en/corp/home [R=permanent,L] RewriteCond %{REQUEST_URI} !^/webapp.*$  RewriteCond %{REQUEST_URI} !^/wcsstore.*$  RewriteCond %{REQUEST_URI} !^/ct-wasadmin-serverstatus.*$  RewriteCond %{REQUEST_URI} !^/js/.*$  RewriteCond %{REQUEST_URI} !^/robots.txt$  RewriteCond %{REQUEST_URI} !(ajax) [NC]  RewriteCond %{REQUEST_URI} !(GetCatalogEntryDetailsByID)  RewriteRule /(.*) /webapp/wcs/stores/servlet/$1 [PT,NE]  #Language Translation Begin  RewriteCond %{HTTP:Accept-Language} ^(es-mx.*) [NC]  RewriteCond %{REQUEST_URI} !^/es/.*  RewriteRule ^/(?:en|pt)/(.*) /es/$1 [PT]  #RewriteRule ^en|pt(.*)$ es$1 [PT]  RewriteCond %{HTTP:Accept-Language} ^pt-BR.*$ [NC]  RewriteCond %{REQUEST_URI} !^/pt/.*  RewriteRule ^/(?:en|es)/(.*) /pt/$1 [PT]  #RewriteRule ^en|es(.*)$ pt$1 [PT]  RewriteCond %{REQUEST_URI} !(ajax) [NC]  RewriteCond %{REQUEST_URI} !(GetCatalogEntryDetailsByID)  RewriteCond %{REQUEST_URI} !(DLControllerCmd) RewriteRule /webapp/wcs/stores/servlet/(.*) /$1 [R=302,NE,L]  RewriteLogLevel 9  RewriteLog "/var/log/httpd/rewrite.log  #Language Translation End

    But this doesnt make any difference.
    Any help is greatly appreciated.
    Thanks