1

I've setup a new Ubuntu 16.04-x86_64 VPS and transferred my WP site over from a Centos 6 VPS.

All went well except that I can't get permalinks to work in WP. I've tried eveything imaginable. Been at it for a couple of days! Configuired, reconfigured, searched, changed, rebooted Apache2 and the VPS what seems like 200 times - but no love. Something tells me I'm missing something very obvious here. mod_rewrite is enabled and working.

I'm working from the command line and Filezilla SFTP. Here's are my config files

TIA for any suggestions.

/etc/apache2/apache2.conf

        Options Indexes FollowSymLinks MultiViews
        # changed from None to FileInfo
        AllowOverride FileInfo
       Require all granted

root@server1:~# sudo a2enmod rewrite
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_AU.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Module rewrite already enabled

.htaccess set to 666. WP is in the /en folder

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /en/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /en/index.php [L]
</IfModule>
# END WordPress
2

When you install Apache, the mod rewrite is not enabled by default. You might need to enable mod rewrite by typing the following command in terminal:

sudo a2enmod rewrite

For more information look into https://www.techiediaries.com/wordpress-permalinks-not-working-404-error/.

| improve this answer | |
1

I've ran into that trouble before with some of my sites when I transferred them to another server.

Here's what I did. edit your apache2.conf at /etc/apache2/ folder.

Run the following command:

nano /etc/apache2/apache2.conf

Scroll down and look for this section with a comment:

# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.

Make sure that this is the one in there:

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

For short, grant it. For your permalinks not to fail.

-Dave

| improve this answer | |

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.