So, I have a pretty common problem - I recently upgraded to Ubuntu Trusty Tahr from Precise, and I had to upgrade apache as a result. Now, my wordpress site is accessible, but I am unable to access any pages within my wordpress site.

So, for example, www.asjweddingsandevents.com works fine, but www.asjweddingsandevents.com/about gives a 404 ("about" is a page in wordpress). I've tried resetting the permalinks from "page name" to "plain" - when in the "plain" form, the pages are accessible via the page_id=-style link (e.g. http://www.asjweddingsandevents.com/?page_id=10), but when I set them back to "page name", they are inaccessible again.

I've double-checked that the apache rewrite mod is enabled (it's being used for other sites on the same server), and I've also double-checked the permissions of the .htaccess file, which are 666. The .htaccess file has the following contents:

# 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]

# END WordPress

I'm not super fluent in wordpress configuration, and even worse, I'm not really an apache ninja, so some help on what I'm doing wrong (or, given this is a general error, how I can troubleshoot what's going wrong) would be much appreciated.

  • Two other things to note - I don't get a server error when I comment out the <IfModule> and </IfModule>, so the rewrite module is loaded. Additionally, if I try to navigate to asjweddingsandevents.com/?page_id=10 when "page name" permalinks are enabled, it redirects me to www.asjweddingsandevents.com/about, so I think it might be a wordpress problem and not an apache problem. – jwir3 Dec 10 '15 at 6:35
  • re save your permalink settings – Mark Kaplun Dec 10 '15 at 6:48
  • @MarkKaplun I did try that, actually, numerous times (unless I'm doing something wrong). I change it from "Page Name" to "Plain", save it, and then change it back and re-save it. I've even tried removing the .htaccess file and re-saving the permalink settings (in order to get it to regenerate it), to no avail. – jwir3 Dec 10 '15 at 13:40
  • Also, I've noticed that when I change the permalink settings to 'plain', it sets the permalink in the 'Edit' view of the page, but if I set it to anything else (e.g. month/day), it stays as the page name. – jwir3 Dec 10 '15 at 13:45
  • turn off all plugins and try again, but most likely something is wrong with your apache – Mark Kaplun Dec 10 '15 at 14:33

I was able to figure out the problem, and for the sake of posterity, I'm posting the answer here. Basically, the new apache2.conf file that was added when I updated my web server had the following lines in it (my document root is /var/www):

<Directory /var/www/>                                                           
        Options Indexes FollowSymLinks                                          
        AllowOverride None                                                      
        Require all granted                                                     

I replaced the AllowOverride None line with AllowOverride all, restarted apache, and the permalinks now work.

Hopefully this will aid someone in the future with a similar problem.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.