2

我已经在 Heroku 上建立了一个 Wordpress 博客,这里使用了很棒的技巧 - http://blog.pardner.com/2012/04/migrating-a-wordpress-blog-to-heroku/使用默认永久链接 ( http://www.mysite.com/blog/?p=123 )似乎一切正常,但如果我尝试切换到使用帖子名称的永久链接 - 我会遇到问题。切换设置并保存后似乎工作正常,但几个小时后(也许 Heroku 的临时文件系统消失了?),它停止工作,并尝试访问帖子将我重定向到我的网站的主页。我按照上面链接中的描述实现了对 .htaccess 的更改,所以我的 .htaccess 文件如下所示:

Options -Indexes
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
4

1 回答 1

4

解决它。由于我的博客位于http://www.mysite.com/blog/而不是http://www.mysite.com/,因此 .htaac​​ces 文件应如下所示:

Options -Indexes
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress
于 2013-09-03T13:35:05.773 回答