0

我从这里下载了示例代码项目“SlothCreator”,然后导出了一个 SlothCreator.doccarchive 文件。

我将 SlothCreator.doccarchive 放在 /var/www/html/ 中。

我的 .htaccess 文件如下。

# 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]

我确认 RewriteEngine 运行良好。

我尝试以下网址,然后看到错误消息“发生未知错误”。或“找不到您要查找的页面。”

http://localhost/documentation/SlothCreator
=> "An unknown error occurred."

http://localhost/SlothCreator.doccarchive/index.html
=> "The page you’re looking for can’t be found."

CentOS 上的 Apache 访问日志:GET /data/documentation/SlothCreator.json HTTP/1.1" 500

"GET /documentation/SlothCreator HTTP/1.1" 200 3789 "-"
"GET /css/index.7bb6526a.css HTTP/1.1" 200 25432 "http:
"GET /js/chunk-vendors.779cfe0d.js HTTP/1.1" 200 93127 
"GET /js/index.2b1836ed.js HTTP/1.1" 200 20015 "http://
"GET /css/documentation-topic.9689e104.css HTTP/1.1" 200 468
"GET /css/documentation-topic~topic~tutorials-overview.83d60
"GET /css/topic.71a5a916.css HTTP/1.1" 200 58203 "http://
"GET /css/tutorials-overview.7d1da3df.css HTTP/1.1" 200 1743
"GET /js/chunk-2d0d3105.459bf725.js HTTP/1.1" 200 6923 "http
"GET /js/documentation-topic.d0b0a554.js HTTP/1.1" 200 83535
"GET /js/documentation-topic~topic~tutorials-overview.e72431
"GET /js/highlight-js-bash.85a55401.js HTTP/1.1" 200 2175 "h
"GET /js/highlight-js-c.99b899e6.js HTTP/1.1" 200 3991 "http
"GET /js/highlight-js-cpp.46268241.js HTTP/1.1" 200 5807 "ht
"GET /js/highlight-js-css.c12e29c1.js HTTP/1.1" 200 7055 "ht
"GET /css/documentation-topic~topic~tutorials-overview.83d60
"GET /theme-settings.json HTTP/1.1" 200 1160 "http://
"GET /css/documentation-topic.9689e104.css HTTP/1.1" 200 468
"GET /js/documentation-topic~topic~tutorials-overview.e72431
"GET /js/documentation-topic.d0b0a554.js HTTP/1.1" 200 83535
"GET /js/highlight-js-custom-markdown.fb3d4662.js HTTP/1.1" 
"GET /js/highlight-js-custom-swift.b1f7a896.js HTTP/1.1" 200
"GET /js/highlight-js-diff.672514df.js HTTP/1.1" 200 841 "ht
"GET /js/highlight-js-http.ec39e120.js HTTP/1.1" 200 998 "ht
"GET /js/highlight-js-java.a814d7f9.js HTTP/1.1" 200 2526 "h
"GET /js/highlight-js-json.471128d2.js HTTP/1.1" 200 452 "ht
"GET /js/highlight-js-javascript.4d4a362d.js HTTP/1.1" 200 5
"GET /js/highlight-js-llvm.ddaa176e.js HTTP/1.1" 200 2749 "h
"GET /js/highlight-js-markdown.451c845b.js HTTP/1.1" 200 212
"GET /js/highlight-js-objectivec.bcdf5156.js HTTP/1.1" 200 2
"GET /js/highlight-js-python.b6226703.js HTTP/1.1" 200 4373 
"GET /js/highlight-js-php.cc8d6c27.js HTTP/1.1" 200 4153 "ht
"GET /js/highlight-js-perl.b3c5d3f2.js HTTP/1.1" 200 4663 "h
"GET /js/highlight-js-ruby.fb547e8d.js HTTP/1.1" 200 3597 "h
"GET /js/highlight-js-scss.33a3a3f7.js HTTP/1.1" 200 7912 "h
"GET /js/highlight-js-swift.0e0d0e76.js HTTP/1.1" 200 7465 "
"GET /js/highlight-js-xml.784eb41b.js HTTP/1.1" 200 2236 "ht
"GET /js/topic.cd2c44f5.js HTTP/1.1" 200 84134 "http://
"GET /js/tutorials-overview.db178ab9.js HTTP/1.1" 200 31964 
"GET /data/documentation/SlothCreator.json HTTP/1.1" 500 527

我能知道问题是什么吗?

我在 CentOS 7 上使用 Apache Web 服务器。.doccarchive 不能在 CentOS 上工作吗?我确认 .doccarchive 在 Mac 上运行良好。

(我也在这里留下了这个问题。)

谢谢你的帮助

4

0 回答 0