我正在使用一个称为锚的cms。http://anchorcms.com/docs/getting-started/configuration
当我转到domain.com/posts时,我得到了404,
当我转到domain.com/index.php/posts页面时,显示正确。
这是我的httpd.conf
档案
<VirtualHost *:443>
#ssl blah blah
DocumentRoot /var/www/anchor/
ServerName domain.com
ServerAlias domain.com
<Directory /var/www/anchor/anchor/>
AllowOverride All
Options Includes MultiViews
Require all granted
</Directory>
</VirtualHost>
这是我的.htaccess
文件放在里面/var/www/anchor/
Options -indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 index.php
</IfModule>
我对如何配置此cms感到有些困惑,.htcaccess应该放在“文档根目录”中,我敢肯定我将其放在正确的文件夹中。我认为不必将URL设置为子目录。有小费吗?
这是我的配置文件。 /var/www/anchor/anchor/config/app.php
<?php
return array(
'url' => '/',
'index' => '',
您的文档根目录是/var/www/anchor
,但您只允许覆盖/var/www/anchor/anchor
。如果您不全局允许覆盖,则将禁用htaccess文件。尝试更改<Directory>
标签以匹配文档根目录:
<Directory /var/www/anchor>
AllowOverride All
Options Includes MultiViews
Require all granted
</Directory>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句