2

I'm using a cms called anchor. http://anchorcms.com/docs/getting-started/configuration

when I go to domain.com/posts I get a 404,

when I go to domain.com/index.php/posts page is displayed correctly.

this is my httpd.conf file

<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>

this is my .htaccess file placed inside /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>

I'm a little confused as how to configure this cms, the .htcaccess supposed to go in the "document root", which I'm fairly sure I put in the correct folder. I don't think I have to set the url to a sub directory. any tips?

here's my config file. /var/www/anchor/anchor/config/app.php

<?php

return array(
        'url' => '/',
        'index' => '',
OnlyMAJ
  • 819
  • 8
  • 21
kmassada
  • 263
  • 5
  • 16
  • 2
    Your document root is `/var/www/anchor`, but you only allow overrides on `/var/www/anchor/anchor`. If you're not globally allowing overrides, that would disable your htaccess file. Try changing your `` tag to match the document root. – Jeremiah Winsley Jan 01 '15 at 14:50
  • @JeremiahWinsley could you please put this as an answer, I'll then edit it with the config I used to make it work. You were right – kmassada Jan 01 '15 at 20:01

1 Answers1

1

Your document root is /var/www/anchor, but you only allow overrides on /var/www/anchor/anchor. If you're not globally allowing overrides, that would disable your htaccess file. Try changing your <Directory> tag to match the document root:

<Directory /var/www/anchor>
    AllowOverride All
    Options Includes MultiViews
    Require all granted
</Directory>
Jeremiah Winsley
  • 2,537
  • 18
  • 30
  • I had to remove the "Options Includes Multiviews" line, because the custom htacces has a definition that overrides it. – kmassada Jan 01 '15 at 20:38