Joomla multilingual subdomain redirect/rewrite

clemclem nginx-forum at nginx.us
Sun Jun 17 18:15:27 UTC 2012


Hi all, 

In fact, I was looking for a transparent redirect. Here is what I finaly
did :

server {
  server_name ~^(?<lang>.+)\.example\.com$;
  location / {
    rewrite /(.*)$ /$lang/$1 break;
    proxy_pass http://www.example.com;
    proxy_redirect http://www.example.com
http://$lang.example.com/$request_uri;
  }
}

server {
  listen 80;
  server_name www.example.com;
...
}

One more question though :  is there a way for Nginx to rewrite all the
URLs in the generated page so they are all SEF ? ie:
http://fr.example.com instead of http://www.example.com/fr ?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,227568,227628#msg-227628



More information about the nginx mailing list