Php 如何在apache上为anchor cms重写指令
我正在使用一个叫做anchor的cms。 当我进入domain.com/posts时 我有一个404 当我转到domain.com/index.php/posts时 页面显示正确 这是我的Php 如何在apache上为anchor cms重写指令,php,apache,.htaccess,mod-rewrite,Php,Apache,.htaccess,Mod Rewrite,我正在使用一个叫做anchor的cms。 当我进入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/a
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>
对于如何配置这个cms,我有点困惑。htcaccess应该放在“文档根目录”中,我很确定我把它放在了正确的文件夹中。我不认为我必须将url设置为子目录。有什么建议吗
这是我的配置文件<代码>/var/www/anchor/anchor/config/app.php
<?php
return array(
'url' => '/',
'index' => '',
您的文档根目录是/var/www/anchor
,但您只允许覆盖/var/www/anchor/anchor
。如果不全局允许覆盖,则会禁用htaccess文件。尝试更改
标记以匹配文档根目录:
<Directory /var/www/anchor>
AllowOverride All
Options Includes MultiViews
Require all granted
</Directory>
允许超越所有
选项包括多视图
要求所有授权
您的文档根目录是/var/www/anchor
,但您只允许覆盖/var/www/anchor/anchor
。如果不全局允许覆盖,则会禁用htaccess文件。尝试更改您的
标记以匹配文档根。@JeremiahWinsley请您将此作为答案,然后我将使用用于使其工作的配置对其进行编辑。你是对的,我不得不删除“选项包括多视图”行,因为自定义htacces有一个覆盖它的定义。
<Directory /var/www/anchor>
AllowOverride All
Options Includes MultiViews
Require all granted
</Directory>