Permalinks on Wordpress EC2

Matt picture Matt · Sep 6, 2012 · Viewed 16k times · Source

I have just transferred my blog from my local webserver to Amazon EC2 Free Linux server, Everything seems to be working now except for permalinks, I disabled and re-enabled them and it still breaks.

I've tried running the script

sudo a2enmod rewrite

But it says a2enmod: command not found while logged into my server as ec2-user

Any help would be much appreciated!

Thanks

Answer

Carl Sednaoui picture Carl Sednaoui · Sep 18, 2012

I just had this same issue and, assuming you are using httpd, you will need to go to /etc/httpd/conf then open http.conf by running sudo vi httpd.conf and then change "AllowOverride" to:

<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>

You may also need to change AllowOverride All here:

# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride All

Then you need to restart httpd by running apachectl -k restart. Note, you may need to actually run sudo apachectl -k restart.

Let me know if that helps.