RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
...causes a perfect, non-hardcoding 301 redirect from "www to non-www", what would the exact opposite look like?
EDIT:
According to Prix' post I've changed the .htaccess
file to the following:
Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
</IfModule>
As already mentioned, this redirects to http://www./
unfortunately. Who can help?