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

thomasdelteil pushed a commit to branch beta-site
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet-site.git


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

commit 848888e5597c6eb772a78e6d8a3e207e773f5a49
Author: Thomas Delteil <thomas.delte...@gmail.com>
AuthorDate: Sat Sep 28 07:18:17 2019 +1000

    Update .htaccess
---
 .htaccess | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/.htaccess b/.htaccess
index 4e98578..09fbc0d 100644
--- a/.htaccess
+++ b/.htaccess
@@ -1,4 +1,32 @@
-Redirects
+Options -Indexes
+DirectorySlash off
+RewriteEngine on
+RewriteOptions AllowNoSlash
+
+# Show file instead of folder for example /api/docs/tutorials.html
+# instead of /api/docs/tutorials/
+RewriteCond %{REQUEST_FILENAME} -d
+RewriteCond %{REQUEST_FILENAME}\.html -f
+RewriteRule ^(.*) $1.html [NC,L]
+
+# Prettify some files like tutorials/io to tutorials/io.html
+RewriteCond %{REQUEST_FILENAME}\.html -f
+RewriteRule ^(.*) $1.html [NC,L]
+
+#API docs needs specific root
+RewriteCond %{REQUEST_URI} \/docs\/api$|\/docs\/tutorials$
+RewriteRule ^(.*) %{REQUEST_URI}/ [R,NC,L]
+
+# Prettify folders like /get_started
+RewriteCond %{REQUEST_URI} !\/$
+RewriteCond %{REQUEST_FILENAME} -d
+RewriteCond %{REQUEST_FILENAME}/index.html -f
+RewriteRule ^(.*) $1/index.html [NC,L]
+
+
+# 404
+ErrorDocument 404 /404.html
+#Redirects
 
 # Python API
 Redirect 301 /versions/master/api/python/index.html 
/api/python/docs/api/index.html

Reply via email to