2

I think I've just about hit my wits end here. I'm trying to get set up on a new Rackspace server and I can't seem to get my URL rewriting to work properly. Here's what I got so far:

My Craft install is in /var/www/html.

apache2.conf

<Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all denied
</Directory>

<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

000-default.conf (my vHost configuration)

<VirtualHost *:80>

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/www


        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

... and then within my craft install in /var/www/html

config/general.php

return array(

  '-- omitted --' => array(
    'devMode'              => true,
    'omitScriptNameInUrls' => true,
    'environmentVariables' => array(
      'siteUrl'            => 'http://-- ommitted --/',
      'fileSystemPath'     => '/var/www/html/www'
    ),
  ),
);

www/.htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On

  # Send would-be 404 requests to Craft
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
  RewriteRule (.+) index.php?p=$1 [QSA,L]

</IfModule>

Am I missing any configuration here? I can't access any of my entries or the admin panel without appending index.php before the path.

Any help would be greatly appreciated!

Jon
  • 345
  • 4
  • 11
  • 1
    Have you made sure that the mod_rewrite extension is enabled? Try a2enmod rewrite – Keith Bartholomew Apr 20 '15 at 22:19
  • Similar posts had to add a RewriteBase / to their .htaccess. http://craftcms.stackexchange.com/questions/8535/cant-remove-index-php-from-my-urls/8555#8555 http://craftcms.stackexchange.com/questions/2832/removing-index-php-from-url-breaks-site/8554#8554http://craftcms.stackexchange.com/questions/2545/urls-other-than-index-cause-500-internal-server-error/2546#2546 http://craftcms.stackexchange.com/questions/5272/500-error-on-installation-since-version-2-3/5284#5284 – Brad Bell Apr 20 '15 at 22:23

1 Answers1

7

On recent Ubuntu systems (for sure on 14.04), mod_rewrite is installed but not enabled within Apache. You may just need to enable the rewrite module and restart Apache.

$ sudo a2enmod rewrite
$ sudo service apache2 restart
Brad Bell
  • 67,440
  • 6
  • 73
  • 143