{"action":"created","issue":{"url":"https://api.github.com/repos/docsifyjs/docsify/issues/720","repository_url":"https://api.github.com/repos/docsifyjs/docsify","labels_url":"https://api.github.com/repos/docsifyjs/docsify/issues/720/labels{/name}","comments_url":"https://api.github.com/repos/docsifyjs/docsify/issues/720/comments","events_url":"https://api.github.com/repos/docsifyjs/docsify/issues/720/events","html_url":"https://github.com/docsifyjs/docsify/issues/720","id":392637485,"node_id":"MDU6SXNzdWUzOTI2Mzc0ODU=","number":720,"title":"怎样实现这样的链接  mydomain.com/zh_cn/document  或者 mydomain.com/en/document，而在网址中没有/#/","user":{"login":"watson8544","id":9019236,"node_id":"MDQ6VXNlcjkwMTkyMzY=","avatar_url":"https://avatars1.githubusercontent.com/u/9019236?v=4","gravatar_id":"","url":"https://api.github.com/users/watson8544","html_url":"https://github.com/watson8544","followers_url":"https://api.github.com/users/watson8544/followers","following_url":"https://api.github.com/users/watson8544/following{/other_user}","gists_url":"https://api.github.com/users/watson8544/gists{/gist_id}","starred_url":"https://api.github.com/users/watson8544/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/watson8544/subscriptions","organizations_url":"https://api.github.com/users/watson8544/orgs","repos_url":"https://api.github.com/users/watson8544/repos","events_url":"https://api.github.com/users/watson8544/events{/privacy}","received_events_url":"https://api.github.com/users/watson8544/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-12-19T14:54:29Z","updated_at":"2018-12-21T01:44:28Z","closed_at":null,"author_association":"NONE","body":"<!-- Love docsify? Please consider supporting our collective:\r\n👉  https://opencollective.com/docsify/donate -->\r\n\r\n我使用docsify有好几个月了，最近买了域名，然后也成功实现了把个人域名加进去。可是现在每次链接都是mydomain.com/#/document_01   mydomain.com/#/zh_cn/document_01  总是有/#/   我怎样才能去掉每篇文章链接中的/#/"},"comment":{"url":"https://api.github.com/repos/docsifyjs/docsify/issues/comments/449209090","html_url":"https://github.com/docsifyjs/docsify/issues/720#issuecomment-449209090","issue_url":"https://api.github.com/repos/docsifyjs/docsify/issues/720","id":449209090,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTIwOTA5MA==","user":{"login":"upupming","id":24741764,"node_id":"MDQ6VXNlcjI0NzQxNzY0","avatar_url":"https://avatars1.githubusercontent.com/u/24741764?v=4","gravatar_id":"","url":"https://api.github.com/users/upupming","html_url":"https://github.com/upupming","followers_url":"https://api.github.com/users/upupming/followers","following_url":"https://api.github.com/users/upupming/following{/other_user}","gists_url":"https://api.github.com/users/upupming/gists{/gist_id}","starred_url":"https://api.github.com/users/upupming/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/upupming/subscriptions","organizations_url":"https://api.github.com/users/upupming/orgs","repos_url":"https://api.github.com/users/upupming/repos","events_url":"https://api.github.com/users/upupming/events{/privacy}","received_events_url":"https://api.github.com/users/upupming/received_events","type":"User","site_admin":false},"created_at":"2018-12-21T01:44:28Z","updated_at":"2018-12-21T01:44:28Z","author_association":"CONTRIBUTOR","body":"刷新的话确实是不能访问的：\r\n\r\n![image](https://user-images.githubusercontent.com/24741764/50319072-4eb2f280-0500-11e9-82a1-6044f42ba539.png)\r\n\r\n看了一下 vuejs 对 [History Mode](https://router.vuejs.org/guide/essentials/history-mode.html) 的解释，这是因为使用了 [`pushState`](https://github.com/docsifyjs/docsify/blob/6ac7bace213145cb655e9a5e9e209384db08e5f9/src/core/router/history/html5.js#L30)，这样我们才能够到达指定 URL 而不用重新加载页面。而刷新的时候是直接请求的，如果服务端不加配置的话就会直接返回 404。\r\n\r\nvuejs 的文档中已经给出了解决方案，就是在刷新请求其他页面的时候，都将其重定向到 `index.html` 就行。\r\n\r\n比如我用的 Nginx，配置如下：\r\n\r\n```nginx\r\nlocation / {\r\n  try_files $uri $uri/ /index.html;\r\n}\r\n```\r\n\r\n效果如下：\r\n\r\nhttps://katex.upupming.site/supported\r\n\r\n另外：Github Pages 是静态资源托管，应该是不支持这种处理的，所以必须使用带服务端技术的托管服务，Firebase、now.sh、heroku 这几个应该都是可以的。"}}
{"actor":{"display_login":"upupming"}}