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

<pre><code>$ sudo a2enmod rewrite
$ sudo service apache2 restart
</code></pre>

CC BY-SA 3.0
2015-04-20T22:26:16.893Z
2015-08-06T19:34:17.023Z
2015-08-06T19:34:17.023Z
Keith Bartholomew
<p>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:</p>

<p>My Craft install is in <code>/var/www/html</code>.</p>

<p><strong>apache2.conf</strong></p>

<pre><code>&lt;Directory /&gt;
        Options FollowSymLinks
        AllowOverride None
        Require all denied
&lt;/Directory&gt;

&lt;Directory /usr/share&gt;
        AllowOverride None
        Require all granted
&lt;/Directory&gt;

&lt;Directory /var/www/&gt;
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
&lt;/Directory&gt;
</code></pre>

<p><strong>000-default.conf</strong> (my vHost configuration)</p>

<pre><code>&lt;VirtualHost *:80&gt;

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


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

&lt;/VirtualHost&gt;
</code></pre>

<p>... and then within my craft install in <code>/var/www/html</code></p>

<p><strong>config/general.php</strong></p>

<pre><code>return array(

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

<p><strong>www/.htaccess</strong></p>

<pre><code>&lt;IfModule mod_rewrite.c&gt;
    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]

&lt;/IfModule&gt;
</code></pre>

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

<p>Any help would be greatly appreciated!</p>

CC BY-SA 3.0
2015-04-20T22:19:57.320Z
Have you made sure that the mod_rewrite extension is enabled? Try `a2enmod rewrite`
Keith Bartholomew
CC BY-SA 3.0
2015-04-20T22:23:32.760Z
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
<url><config><install><apache>
omitScriptNameInUrls is not working
# omitScriptNameInUrls is not working

(Asked by: username_0 on 2015-04-20)

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

        Options FollowSymLinks
        AllowOverride None
        Require all denied



        AllowOverride None
        Require all granted



        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted


000-default.conf (my vHost configuration)


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


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



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

    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]



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!

**Tags:** url, config, install, apache

> **Comments:**
> **username_1**: Have you made sure that the mod_rewrite extension is enabled? Try `a2enmod rewrite`  
> **username_2**: 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  

---

## 1 answers

### Answer by username_1 on 2015-04-20. Score: 7 | Accepted answer

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


---

