Enabling mod_rewrite on Amazon Linux
Posted
by
L. De Leo
on Server Fault
See other posts from Server Fault
or by L. De Leo
Published on 2012-11-05T16:20:10Z
Indexed on
2012/11/05
17:03 UTC
Read the original article
Hit count: 427
apache2
|amazon-ec2
I'm trying to enable mod_rewrite on an Amazon Linux instance. My Directory directives look like this:
<Directory />
Order deny,allow
Allow from all
Options None
AllowOverride None
</Directory>
<Directory "/var/www/vhosts">
Order allow,deny
Allow from all
Options None
AllowOverride All
</Directory>
And then further down in httpd.conf I have the LoadModule directive:
... other modules...
#LoadModule substitute_module modules/mod_substitute.so
LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule proxy_module modules/mod_proxy.so
... other modules...
I have commented out all the Apache modules not needed by Wordpress.
Still when I issue http restart and then check the loaded modules with /usr/sbin/httpd -l
I get only:
[root@foobar]# /usr/sbin/httpd -l
Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c
Inside the virtual host containing the Wordpress site I have an .htaccess containing:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
The .htaccess is owned by apache which is the user apache runs under. The apachectl -t
command returns Syntax OK
What am I doing wrong? What should I check?
© Server Fault or respective owner