RewriteEngine on # 'Canonical hostname forcing' RewriteCond %{HTTP_HOST} !^www\.skazka\.no RewriteCond %{HTTP_HOST} !^$ RewriteCond %{SERVER_PORT} !^80$ RewriteRule ^(.*) http://www.skazka.no:%{SERVER_PORT}/$1 [R=301,L] RewriteCond %{HTTP_HOST} !^www\.skazka\.no RewriteCond %{HTTP_HOST} !^$ RewriteRule ^(.*) http://www.skazka.no/$1 [R=301,L] # This is done with mod_rewrite module in Apache 1.3 HTTP server. # See http://httpd.apache.org/docs/mod/mod_rewrite.html # # Note: you may need to use matching patterns with leading slash # depending on your particular Apache installation, e.g. # # RewriteRule ^/(.*) http://www.skazka.no:%{SERVER_PORT}/$1 [R=301,L] # RewriteRule ^/(.*) http://www.skazka.no/$1 [R=301,L]