-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
怎样实现这样的链接 mydomain.com/zh_cn/document 或者 mydomain.com/en/document,而在网址中没有/#/ #720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
… On Wed, Dec 19, 2018, 10:54 PM LiHuashen ***@***.*** wrote:
我使用docsify有好几个月了,最近买了域名,然后也成功实现了把个人域名加进去。可是现在每次链接都是
mydomain.com/#/document_01 mydomain.com/#/zh_cn/document_01 总是有/#/
我怎样才能去掉每篇文章链接中的/#/
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#720>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AXmHhPC8ul4dWzcXOOZYUIiWakMD78_gks5u6lMsgaJpZM4ZaZm2>
.
|
谢谢!我昨晚试了把rountermode配置成history模式,可以去掉#,可是每次刷新页面,就出现404了,我查到vuejs,是这样规定的,不过可以有解决方案。你有解决方案吗?我不是很懂前端 |
刷新的话确实是不能访问的: 看了一下 vuejs 对 History Mode 的解释,这是因为使用了 vuejs 的文档中已经给出了解决方案,就是在刷新请求其他页面的时候,都将其重定向到 比如我用的 Nginx,配置如下: location / {
try_files $uri $uri/ /index.html;
} 效果如下: https://katex.upupming.site/supported 另外:Github Pages 是静态资源托管,应该是不支持这种处理的,所以必须使用带服务端技术的托管服务,Firebase、now.sh、heroku 这几个应该都是可以的。 |
非常感谢!我试下部署到netlify上看能不能试下这种操作 |
For the English speakers/readers: using the
as the web page doesn't hit the To fix this, you must configure your hosting server to redirect any non-root URLs to the root. That is: With Firebase Hosting & Docsify {
"hosting": {
"public": "docs",
"ignore": [".*"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
} This will re-route every URL under your domain and send it to Issues: the sidebar header defaults to My config with the above Firebase Hosting config is: // history mode routing
routerMode: "history",
nameLink: "/", Thanks to everyone here for investigating and Google Translate 💯 I will endeavour to update the docs with this information. |
@jthegedus great job! Closing this issue. I've created #759 to improve docs. |
The docs which how to deploy documents to NOW.sh does not detailed enough. Please update it. Thanks so much!! Here's the docs I talk about just now. |
@watson8544 By the way, you should be clear about the difference between v1 and v2 of now.sh. |
There is a lot of work to improve the hosting docs. I will endeavor to improve them when I get a change. The changes I think need to be made are:
|
@jthegedus How to use Related Issue: #238 |
我使用docsify有好几个月了,最近买了域名,然后也成功实现了把个人域名加进去。可是现在每次链接都是mydomain.com/#/document_01 mydomain.com/#/zh_cn/document_01 总是有/#/ 我怎样才能去掉每篇文章链接中的/#/
The text was updated successfully, but these errors were encountered: