WordPress

If you’re setting up WordPress on a new server you may find that your custom permalinks don’t work and worse changes you make to your .htaccess file are ignored or have no effect. It sounds like you need to modify your VHOST configuration file on your web server.

Modify VHOST to AllowOverride

By default AllowOverride is disabled, this means .htaccess files and files like php.ini are ignored. Even if you enable mod_rewrite using

sudo a2enmod rewrite

your .htaccess will still be ignored.

You’ll want to login to your server (via Terminal / shell) and then each of these commands.

  • Nano is my favourite CLI ’text editor’ so type sudo nano /etc/apache2/sites-available/default

Look through the file for:

1
2
3
4
5
AllowOverride None
Options MultiViews FollowSymlinks
Order allow,deny
Allow from all
Header Set Cache-Control no-cache
  • Change AllowOverride to ALL
  • Ctrl+x and Y to save the file
  • Enter sudo apache restart (this works for Ubuntu and Apache)

Let me know if you found that Allow Override was set to None and this fixed your problem please.

Tags: Apache, Server, Ubuntu, VHOST

Read more from my blog for an introduction and quick tips on developing in Hugo or UCTD.

Meet the author

Photo for Damien Saunders
Damien Saunders
An experienced management consultant and business leader interested in digital transformation, product centred design and scaled agile. If I'm not writing about living with UCTD (an autoimmune disease), I'm probably listening to music, reading a book or learning more about wine.