AddCharset utf-8 .html
AddCharset utf-8 .css
LanguagePriority en
ForceLanguagePriority Prefer Fallback

RewriteEngine on
RewriteBase /Style/CSS

# Full filenames without a language extension (i.e., foo.html instead
# of foo.en.html) are aliases for the English versions.
# The exeption is head.html, which is included by SSI in some
# documents under Test/
#
# The other exceptions (button, microscape, multicolumn, etc.) are
# very old documents, kept for history.
#
# And draft.html used to be a symlink to Overview.html, which up to
# 1997 or 1998 contained links to drafts. Links to drafts are now in
# current-work, and the old links were moved to history.html, so best
# thing is to redirect draft.html there.

RewriteRule ^(head\.html$) $1 [L]
RewriteRule ^(button\.html$) $1 [L]
RewriteRule ^(css1-qr\.html$) $1 [L]
RewriteRule ^(css2dsssl\.html$) $1 [L]
RewriteRule ^(css2-notes\.html$) $1 [L]
RewriteRule ^(Dislosures\.html$) $1 [L]
RewriteRule ^(draft1\.html$) $1 [L]
RewriteRule ^(draft2\.html$) $1 [L]
RewriteRule ^(draft3\.html$) $1 [L]
RewriteRule ^(draft4\.html$) $1 [L]
RewriteRule ^(draft5\.html$) $1 [L]
RewriteRule ^(draft6\.html$) $1 [L]
RewriteRule ^(draft\.html$) history.html [R=permanent,L]
RewriteRule ^(hang-title\.html$) $1 [L]
RewriteRule ^(history\.html$) $1 [L]
RewriteRule ^(microscape\.html$) $1 [L]
RewriteRule ^(multi-column1\.html$) $1 [L]
RewriteRule ^(multi-column2\.html$) $1 [L]
RewriteRule ^(multi-column3\.html$) $1 [L]
RewriteRule ^(multi-column\.html$) $1 [L]
RewriteRule ^(myoverview\.html$) $1 [L]
RewriteRule ^(Overview-test\.html$) $1 [L]
RewriteRule ^(speech\.html$) $1 [L]
RewriteRule ^(w3c\.html$) $1 [L]
RewriteRule ^(WD-css1-960415\.html$) $1 [L]
RewriteRule ^(WD-css1-960417\.html$) $1 [L]

RewriteRule ^([^./]*)\.html$ $1.en.html
RewriteRule ^([^./]*)\.php3$ $1.en.php3

# There is currently no members.en.html, redirect to .php3 enstead:

RewriteRule ^(members.en).html$ $1.php3

# The CSS WG blog is maintained elsewhere:

RewriteRule ^blog$ /2005/06/blog/CSSBlog.php [P,L]

# Removed files:

RewriteRule ^Discuss(\..*)?$ learning$1 [R=permanent,L]

# Safari prefers application/xml (q=1.0) to text/html (q=0.9), which
# would give it the .rss file instead of the .html file, unless we
# lower the quality factor of .rss:

<Files *.rss>
  ForceType application/xml;qs=0.2
</Files>

<Files *.atom>
  ForceType application/atom+xml;qs=0.8
</Files>

# EOT and WOFF are Web font formats
# The MIME type for WOFF is in the process of being registered as of 2011.
# There is none for EOT yet.

AddType application/font-woff woff
AddType application/octet-stream eot
AddType application/json json

# If there is an Origin request header with either the value
# http://www.w3.org/ or https://www.w3.org/, then copy that value to
# store that value in environment variable ORIGIN.
#
SetEnvIfNoCase Origin (https?://www.w3.org(:.*)?) ORIGIN=$1

<Files *.woff>
  # If there is an ORIGIN, copy it to the Access-Control-Allow-Origin
  # response header.
  #
  Header set Access-Control-Allow-Origin %{ORIGIN}e env=ORIGIN
  # "http://www.w3.org https://www.w3.org"
</Files>

# SSI is enabled on some files that are used in the Test directory,
# which don't have the current style yet.

<files "head.html">
  Options +Includes
  SetHandler server-parsed
  ForceType text/html
</files>
<files ~ "(top|foot).en.html">
  Options +Includes
  SetHandler server-parsed
  ForceType text/html
</files>

# hsl-rgb CGI script (converts between HSL and RGB color notations)

RewriteRule ^(hsl-rgb.*) http://jessica.w3.org/cgi-bin-www/hsl-rgb/$1 [P]
