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!

2

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.