【发布时间】:2013-01-17 12:44:18
【问题描述】:
我在共享的 Apache 服务器上使用Jekyll 生成了一个小型博客。我一直在关注this guide 来设置服务器,以便我可以通过 GitHub 推送更改来更新站点,但我什至还没有走那么远。将域指向生成的/_site 子目录的.htaccess 重写规则让我很难过。我正在使用的代码(如下)正确地重定向了站点,但是我读过的指南说此代码应该从 URL 中隐藏子目录,而这并没有发生。它在主页上正常工作,但子页面的 URL 中仍然有 /_site/。有什么想法吗?
My website
.htaccess 文件
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?joejoiner.tk$ [NC]
RewriteCond %{REQUEST_URI} !^/_site/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /_site/$1
RewriteCond %{HTTP_HOST} ^(www.)?joejoiner.tk$ [NC]
RewriteRule ^(/)?$ _site/index.html [L]
【问题讨论】:
标签: apache .htaccess url-rewriting blogs jekyll