0

I have an .htaccess set to permissions 777 with a simple rule:

<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule> 

In /etc/apache2/apache2.conf, I've deleted all of the commands except a simplified:

<Directory /> AllowOverride All </Directory> 

In /etc/apache2/sites-enabled/000-default.conf, I've added:

<Directory /var/www/html> AllowOverride All Options -Indexes +FollowSymLinks +MultiViews Order allow,deny Allow from all </Directory> 

I've also "sudo service apache2 restart" (Ubuntu 14.04)

But for whatever reason, I can't get calls to http://www.myserver.com/blah/blah to be routed to index.php

It feels like the .htaccess is being ignored or the rewrite rule isn't running.

I'm out of ideas on where to look and I've followed the other SO posts without luck. Any ideas?

2
  • Verify whether your .htaccess is enabled or not, by putting same garbage (random) text on top of your .htaccess and see if it generates 500 (internal server) error or not? Commented Jun 17, 2014 at 20:02
  • @anubhava Tebro figured it out, below. Thanks though! Commented Jun 17, 2014 at 21:31

1 Answer 1

1

Make sure that you have the rewrite module turned on.

sudo a2enmod rewrite sudo service apache2 restart 

Since you have the if check for the module that means that there wont be any errors if it is not enabled.

Sign up to request clarification or add additional context in comments.

1 Comment

Gosh darn it, I knew I forgot something. :) Thanks Tebro! BTW, can you correct your answer? It is "sudo a2enmod rewrite"

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.