Question

WordPress Permalinks Broken

  • Posted on April 9, 2013
  • msomersAsked by msomers

I followed the guide on installing Wordpress on Ubuntu 12. Everything is working fine, except for when I change my permalink structure to Month/Post Name. The main blog page works, but post links throw a 404 error.

I tried a few things:

  • Enabled mod_rewrite with a2enmod rewrite and restarted Apache
  • Set permissions to .htaccess to 777 so Wordpress could update the file as needed when I updated the Permalink settings.

Is there something else I’m missing here to get this working?

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Permalink Problem

Inside of this file, we want to change all things.

sudo nano /etc/apache2/sites-available/000-default.conf

000-default.conf - should look something like this:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html

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

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

When you are finished, save and close the file.

Next, we need to enable the rewrite module, which allows you to modify URLs. You can do this by typing:

sudo a2enmod rewrite

After you have made these changes, restart Apache:

sudo service apache2 restart

If you’ve followed the initial steps and you’ve not been able to get rewrite to work for you, do the following ::: <br> <br>Firstly it’s important you restart the apache2 server without any errors, ( Restarting web server apache2 : error … ) ::: If you do get this error do the folllowing ::: <br> <br>1) sudo nano /etc/apache2/httpd.conf <br>2) Add, ServerName localhost <br> <br> <br>Open up the following file, and replace every occurrence of “AllowOverride None” with “AllowOverride all” <br> <br>1) sudo nano /etc/apache2/sites-available/default <br>2) sudo service apache2 restart

Im having an odd issue with this, that on google I find was relevant, and the fixes work, from wordpress 2.5 (im on 4.3)

Permalinks work, if I make the structure “/index.php/%postname%” Anything else… doesnt work. Any ideas ??? :)