diff options
author | Jonas Smedegaard <dr@jones.dk> | 2016-04-17 10:53:56 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2016-04-17 10:53:56 +0200 |
commit | 1eb364f42804fb04daefb8b34ca42b2cc7cc39fa (patch) | |
tree | a1ef714581a1cecce6937c32ca9e71163aa345ee /apache2/conf-available/local-html5.conf | |
parent | 64dc2dd8e6b275afee366a94c01ee800a43d94d5 (diff) |
Separate snippets for adding/stripping www.
Diffstat (limited to 'apache2/conf-available/local-html5.conf')
-rw-r--r-- | apache2/conf-available/local-html5.conf | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/apache2/conf-available/local-html5.conf b/apache2/conf-available/local-html5.conf index cc490bf..aedc96a 100644 --- a/apache2/conf-available/local-html5.conf +++ b/apache2/conf-available/local-html5.conf @@ -359,46 +359,7 @@ AddDefaultCharset utf-8 # | Suppressing / Forcing the `www.` at the beginning of URLs | # ---------------------------------------------------------------------- -# The same content should never be available under two different -# URLs, especially not with and without `www.` at the beginning. -# This can cause SEO problems (duplicate content), and therefore, -# you should choose one of the alternatives and redirect the other -# one. -# -# By default `Option 1` (no `www.`) is activated. -# http://no-www.org/faq.php?q=class_b -# -# If you would prefer to use `Option 2`, just comment out all the -# lines from `Option 1` and uncomment the ones from `Option 2`. -# -# (!) NEVER USE BOTH RULES AT THE SAME TIME! - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Option 1: rewrite www.example.com → example.com - -<IfModule mod_rewrite.c> - RewriteEngine On - RewriteCond %{HTTPS} !=on - RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] - RewriteRule ^ %{ENV:PROTO}://%1%{REQUEST_URI} [R=301,L] -</IfModule> - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Option 2: rewrite example.com → www.example.com -# -# Be aware that the following might not be a good idea if you use "real" -# subdomains for certain parts of your website. - -# <IfModule mod_rewrite.c> -# RewriteEngine On -# RewriteCond %{HTTPS} !=on -# RewriteCond %{HTTP_HOST} !^www\. [NC] -# RewriteCond %{SERVER_ADDR} !=127.0.0.1 -# RewriteCond %{SERVER_ADDR} !=::1 -# RewriteRule ^ %{ENV:PROTO}://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] -# </IfModule> +# (moved to separate snippets) # ###################################################################### |