blob: dcac7060468af5b4d7e780e3b62c56fcc27bd2b5 [file] [log] [blame]
# no cahce for root index redirection
<If "%{REQUEST_URI} =~ m#^/?([\w\-]+\.html)?$#">
<IfModule mod_expires.c>
ExpiresActive off
</IfModule>
<IfModule mod_headers.c>
Header always set Cache-Control "no-store, no-cache, must-revalidate"
Header always set Expires "Thu, 01 Dec 1994 16:00:00 GMT"
Header always merge Vary "Accept-Language"
</IfModule>
</If>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond "%{HTTP:Accept-Language}" ^zh [NC]
RewriteRule ^/?(index\.html)?$ "/zh/index.html" [L,R=302]
RewriteRule ^/?(index\.html)?$ "/en/index.html" [L,R=302]
# special redirection for examples & handbook
RewriteCond "%{HTTP:Accept-Language}" ^zh [NC]
RewriteRule ^/?faq/?([\w\-/]+)?$ "/zh/docs3-v2/java-sdk/faq/$1" [L,R=302]
RewriteRule ^/?faq/?([\w\-/]+)?$ "/en/docs/java-sdk/faq/$1" [L,R=302]
RewriteCond "%{HTTP:Accept-Language}" ^zh [NC]
RewriteRule ^/?([\w\-]+)\.html$ "/zh/$1.html" [L,R=302]
RewriteRule ^/?([\w\-]+)\.html$ "/en/$1.html" [L,R=302]
</IfModule>