Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permalinks on Wordpress EC2

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

like image 927
Matt Avatar asked Sep 06 '12 04:09

Matt


People also ask

How do I find the hostname of an EC2 instance?

You can see the hostname values for an existing EC2 instance in the Details tab for the EC2 instance: Hostname type: The hostname in IP name or resource name format. Private IP DNS name (IPv4 only): The IP name that will always resolve to the private IPv4 address of the instance.


2 Answers

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.

like image 190
Carl Sednaoui Avatar answered Oct 07 '22 19:10

Carl Sednaoui


For Ubuntu, change the "AllowOverride All" at the following location:

"The additional step I had to take was to edit /etc/apache2/sites-enabled/000-default.

In that file you'll find an AllowOverride setting for /var/www, saying "None".

Change the setting to say: AllowOverride All "

Credit to ljonas @ http://wordpress.org/support/topic/solved-permalinks-working-in-apache2-ubuntu-1010

like image 33
musique12340987 Wic Avatar answered Oct 07 '22 17:10

musique12340987 Wic