WordPress permalinks tried everything

Posted June 20, 2014 28.2k views
I'm running Ubuntu Lamp and I can't get WP permalinks working. I migrated my site using WordPress Duplicator which has worked for me many times before. YES, .htaccess is writing properly. (there is also another .htaccess in /wordpress/.htaccess -- but all indications show that WP writes to the one in the site root) I have added `Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all` to the following files: /etc/apache2/sites-available/default /etc/apache2/sites-available/ I have added `ServerName localhost` to: /etc/apache2/httpd.conf I have run:
a2enmod rewrite
Then restarted Apache. I have created new mySQL databases and users and build new packages with Duplicator and tried those. I have tried disabling permalinks and then re-enabling after install. For record, the site does work when permalinks are disabled. I feel like I have tried just about every forum suggestion out there. I'm just starting out so I'm fine scrapping the whole thing and starting over but I'm not convinced it would do anything. I feel like I'm still missing something. Looking forward to your suggestions in the meantime I will keep digging.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
6 answers
@jon: no ... I didin't come across that one (what does it do?) But I solved my issue. So I started fresh w/ Ubuntu 14.04 32bit ... - Set up mySQL just following onscreen instructions. - Installed phpmyadmin per - Added
ServerName localhost
to /etc/apache2/apache2.conf - Edited
<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
to say
AllowOverride All
. I think ^this is the part I was missing. Then ran
a2enmod rewrite
. Installed using Duplicator and set permalinks to Post Name. Alls well that ends well, well that's what I say.
by Sharon Campbell
When we accept articles for the DigitalOcean community, we look for several characteristics: relevant and interesting topics, clear writing style, and appropriate formatting. The last concern, formatting, is an important part of the article submission process – a clearly formatted article can help the reader get through the tutorial with the greatest amount of comprehension and efficiency.

First thing is you have to enable the URL rewrite module:

a2enmod rewrite

Second thing you have to edit the entry in your apache conf file.:

<VirtualHost *:80>
  here you have your regular stuff

<Directory />
  Options FollowSymLinks
  AllowOverride None
<Directory /var/www/>
  Options Indexes FollowSymLinks MultiViews
  AllowOverride All
  Order allow,deny
  allow from all
Hate asking, but did you run this:
a2ensite; service apache2 reload
For future domains/sub-domains, I've written a simple script for this. Let's say you want to add "" to your server, you'd run this: curl|bash For, it would be this: curl|bash If you want to see what it does, just run it without "|bash" on the end.

Just add the information that’s located in the wordpress .htaccess file to the apache main configuration file. This shows how to do it:

It’s better to do it this way because the server doesn’t take a performance hit. .htaccess files are only meant to be used in cases where you don’t have access to the main server configuration files, such as when you are on shared hosting. Since you are hosting on digitalocean you should be using the main configuration file and not .htaccess files.