I downloaded the sample code project 'SlothCreator' from here then exported a SlothCreator.doccarchive file.
I placed the SlothCreator.doccarchive in /var/www/html/. I use Apache web server on CentOS 7.
My .htaccess file is as follows.
# Enable custom routing.
RewriteEngine On
# Route documentation and tutorial pages.
RewriteRule ^(documentation|tutorials)\/.*$ SlothCreator.doccarchive/index.html [L]
# Route files and data for the documentation archive.
RewriteRule ^(css|js|data|images|downloads|favicon\.ico|favicon\.svg|img|theme-settings\.json|videos)\/.$ SlothCreator.doccarchive/$0 [L]
# If the file path doesn't exist in the website's root ...
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# ... route the request to that file path with the documentation archive.
RewriteRule .* SlothCreator.doccarchive/$0 [L]
I confirmed that the RewriteEngine works well.
I try the following urls then see error message "An unknown error occurred." or "The page you’re looking for can’t be found."
http://localhost/documentation/SlothCreator
=> "An unknown error occurred."
http://localhost/SlothCreator.doccarchive/index.html
=> "The page you’re looking for can’t be found."
Can I know what the problem is?
Doesn't it work with CentOS?
I found what is the cause. The problem is Case Sensitive in my cent os.
"http://localhost/documentation/SlothCreator" requests /data/documentation/SlothCreator.json, but the file name is /data/documentation/slothcreator.json.
So I added follows to the .htaccess.
RewriteRule /data/documentation/SlothCreator.json /data/documentation/slothcreator.json
then It works well.