WordPress Permalink Changed, Can't Access Pages
amazon-ec2, wordpress
Solution
I found this by googling "permalinks htaccess amazon ec2", it might help: http://guiem.info/permalinks-on-wordpress-amazon-ec2/
Problem
On the front end of my WordPress 3.5.2 site, I have three buttons: Home, Blog and Sample Page. When my Permalink Settings are set to `Default`, I can access these three pages: ``` Home: http://ec2-xx-xxx-x-xxx.compute-1.amazonaws.com/ Blog: http://ec2-xx-xxx-x-xxx.compute-1.amazonaws.com/?page_id=13 Sample Page: http://ec2-xx-xxx-x-xxx.compute-1.amazonaws.com/?page_id=2 ``` However, when I changed my Permalink Settings to `Post name`, and refreshed the browser, I cannot access the Blog page and Sample page. I get the following errors: ``` Blog: http://ec2-xx-xxx-x-xxx.compute-1.amazonaws.com/blog Not Found The requested URL /blog/ was not found on this server. Sample Page: http://ec2-xx-xxx-x-xxx.compute-1.amazonaws.com/sample-page/ Not Found The requested URL /sample-page/ was not found on this server. ``` In WordPress's `Settings -> Permalink Settings`, I also get this message: `If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file. Click in the field and press CTRL + a to select all.` When I checked my permissions for the .htaccess file, I got 644, so I changed it to 666 and the message disappeared (I changed it back to 644) ``` [ec2-user@ip-xx-xxx-xxx-xx html]$ ls -l .htaccess -rw-r--r-- 1 root root 258 Jul 25 21:49 .htaccess [ec2-user@ip-xx-xxx-xxx-xx html]$ sudo chmod 666 .htaccess ``` I can still access my home page after changing the permalink settings to `Post name`. I'm not sure if this has anything to do with my problem but I installed my WordPress site in a subdirectory (xxx) on my Amazon EC2 micro instance and I changed WP's General Settings as follows: ``` WordPress Address (URL): http://ec2-xx-xxx-x-xxx.compute-1.amazonaws.com/xxx Site Address (URL): http://ec2-xx-xxx-x-xxx.compute-1.amazonaws.com ```