我们的网站分为2个部分,主要网站是ruby,博客是Wordpress。红宝石网站很好,但是我在子文件夹中的博客有问题。所有页面都可以使用,但是首页和管理员必须先将/index.php放在末尾才能使用。我很确定问题/修复在Apache conf文件和/或.htaccess中。他们在这里。
Apache conf文件
<VirtualHost *:80>
ServerName site.com
DocumentRoot /var/www/site/code/public
PassengerRuby /home/site/.rvm/gems/ruby-2.1.9@site/wrappers/ruby
RailsEnv production
RackEnv production
ErrorLog /var/www/site/code/log/error.log
CustomLog /var/www/site/code/log/requests.log combined
Alias /blog/ "/var/www/blog/wordpress"
<Directory "/var/www/blog/wordpress">
DirectoryIndex index.php
AllowOverride All
Options Indexes FollowSymLinks MultiViews
</Directory>
</VirtualHost>
和。htaccess几乎是标准的一个
# 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
如果我访问site.com/blog,它将显示我的Ruby站点404页面。
非常感谢您的帮助。