Search This Blog

Friday, July 01, 2016

For Posterity

Having spent more hours than seems decent trying to get to the bottom of the problem with internal links in WordPress, the Gorse Fox thought he would document the solution for posterity.

If you wish to use any internal "permalink" style, other than the default, several things have to come together:

  1. Make sure the rewrite module in Apache is enabled (Used for WordPress Permalinks)
    sudo a2enmod rewrite
  2. A stanza needs to be added to /etc/apache2/sites-enabled/000-default.conf
           # Added by AJM for Wordpress permalink
           <directory html="" var="" www="">
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride All
                    Order allow,deny
                    allow from all
           </directory> 
    
    Note that < and > in the text above should be "less than sign" (U+003C) and "greater than sign" (U+003E) but they keep getting interpreted by html as tags and the Gorse Fox can't work out how to avoid this at present
  3. Make sure /var/www/html/.htaccess exists and is writable
    sudo touch /etc/www/html/.htaccess
    sudo chmod 666 /etc/www/html/.htaccess
  4. Restart apache
  5. From WordPress Dashboard "Settings" change Permalinks structure to your chosen preference.

No comments: