this is the only question I found with Google according this issue.
Here is my solution for nginx as reverse proxy to apache. I'm running magento 1.8.0.0 as multisite. I also have multi domain SSL installed. I've disabled it and tried to make redirect with .htaccess config (as Sander Mangel suggested), but I ended up with redirect loop on https:// pages.
If there is Nginx set up as reverse proxy to apache then try to edit nginx vhost files like this:
server { listen 80; listen 443 ssl; server_name www.domain.com; return 301 $scheme://domain.com$request_uri; ssl_certificate /path/to/your/ssl/domain.crt; ssl_certificate_key /path/to/your/ssl/domain.key; ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!MD5; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; } server { listen 80; listen 443 ssl; server_name domain.com; ssl_certificate /path/to/your/ssl/domain.crt; ssl_certificate_key /path/to/your/ssl/domain.key; ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!MD5; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; .... // the rest of config goes here }
Then restart nginx (like /etc/init.d/nginx restart)
That it. 301 Redirect should work on every page redirecting www to non-www
Thanks,
Sharif