[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: issue 4813: replace urchin.js with analytics.js and fix redundant ho
From: |
fedelogy |
Subject: |
Re: issue 4813: replace urchin.js with analytics.js and fix redundant hostnames (issue 294020043 by address@hidden) |
Date: |
Wed, 30 Mar 2016 11:08:28 +0000 |
https://codereview.appspot.com/294020043/diff/1/Documentation/web/server/lilypond.org.htaccess
File Documentation/web/server/lilypond.org.htaccess (left):
https://codereview.appspot.com/294020043/diff/1/Documentation/web/server/lilypond.org.htaccess#oldcode19
Documentation/web/server/lilypond.org.htaccess:19: # Deny following of
symlinks by robots.
On 2016/03/30 10:20:52, PhilEHolmes wrote:
This version causes Firefox to complain, with "Firefox has detected
that the
server is redirecting the request for this address in a way that will
never
complete"
A bit more research led me to:
# Permanent redirect from http://www.lilypond.org to
http://lilypond.org
RewriteCond "%{HTTP_HOST}" "^www\.(.+)$" [NC]
RewriteRule "^(.*)$" "http://%1/$1" [R=301,L,NE]
which does work, and is in place currently.
Are you sure?
It's not working here (I've cleared the cookies and checked also on a
fresh browser). Any www URL cannot redirect to the non-WWW URL.
Epiphany says "Too many redirects". It's a redirect loop.
Maybe we need a second condition to prevent the loop?
If you see the last example here (actually the opposite of what we are
trying to achieve):
https://httpd.apache.org/docs/2.4/rewrite/remapping.html#canonicalhost
what is the second line doing?
RewriteCond "%{HTTP_HOST}" "!^www\." [NC]
RewriteCond "%{HTTP_HOST}" "!^$"
RewriteRule "^/?(.*)" "http://www.%{HTTP_HOST}/$1" [L,R,NE]
I used this as a base to work on what I wrote, but I did not understand
what this second line was doing in that context so I omitted it. How can
we adapt it to enforce the non-WWW?
https://codereview.appspot.com/294020043/