You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2022/04/14 03:01:59 UTC

[dubbo-website] branch asf-site updated: Update .htaccess

This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new fd61874ae1 Update .htaccess
fd61874ae1 is described below

commit fd61874ae19df18bd11cc7274307bef50c63eba3
Author: Albumen Kevin <jh...@gmail.com>
AuthorDate: Thu Apr 14 11:01:54 2022 +0800

    Update .htaccess
---
 .htaccess | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/.htaccess b/.htaccess
index efc131a97e..09ca3d6446 100644
--- a/.htaccess
+++ b/.htaccess
@@ -1,9 +1,16 @@
 <IfModule mod_rewrite.c>
-RewriteEngine On
-RewriteCond %{SERVER_PORT} !^443$
-RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
+  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 ^/$ /en [L,R=301]
+  RewriteRule ^/?(index\.html)?$ "/en/index.html" [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>